Forest_Client/Forest/Assets/Scripts/Gameplay/Level/Kong.cs

42 lines
1.1 KiB
C#
Raw Normal View History

2024-06-12 15:01:54 +08:00
using System.Collections.Generic;
using UnityEngine;
namespace Gameplay.Level
{
public class Kong
{
public Thumbtack LevelThumbtack { get; set; }
public GameObject Obj { get; set; }
public int HoleIndex { get; set; }
public List<Plank> Planks { get; set; } = new List<Plank>();
private GameObject _gfxThumbtackUp;
private ParticleSystem _particleSystem;
public Kong(GameObject obj)
{
Obj = obj;
_gfxThumbtackUp = Obj.transform.Find("gfx_thumbtack_up").gameObject;
_particleSystem = _gfxThumbtackUp.GetComponent<ParticleSystem>();
}
public Kong(GameObject obj,int holeIndex)
{
Obj = obj;
HoleIndex = holeIndex;
_gfxThumbtackUp = Obj.transform.Find("gfx_thumbtack_up").gameObject;
_particleSystem = _gfxThumbtackUp.GetComponent<ParticleSystem>();
}
public void ShowGfx()
{
_gfxThumbtackUp.SetActive(true);
GfxManager.Instance.ShowGfxOnce(_particleSystem, _gfxThumbtackUp);
}
}
}