void Awake() { // Find n set SubLabel levelLabel = GameObject.Find("UI Root/UICam/UIPanel/Status/Level/Sub").GetComponent<UILabel>(); AttackLabel = GameObject.Find("UI Root/UICam/UIPanel/Status/Attack/Sub").GetComponent<UILabel>(); CriticalLabel = GameObject.Find("UI Root/UICam/UIPanel/Status/Critical/Sub").GetComponent<UILabel>(); HealthLabel = GameObject.Find("UI Root/UICam/UIPanel/Status/Health/Sub").GetComponent<UILabel>(); ManaLabel = GameObject.Find("UI Root/UICam/UIPanel/Status/Mana/Sub").GetComponent<UILabel>(); // Get PlayerInfo PlayerInfo = GameObject.Find("PLAYER/Cha_Knight").GetComponent<CharactorControl>(); }
void OnTriggerEnter2D(Collider2D collision) { CharactorControl ch_control = collision.GetComponent <CharactorControl>(); if (ch_control != null) { //ch_control.Jump(); Debug.Log("collision upper"); Rigidbody2D body = collision.GetComponent <Rigidbody2D>(); OneShotSoundManager.getInstance().PlayJumpPlayer(this.gameObject); body.velocity = new Vector2(body.velocity.x, 20.0f); } }
public CharactorInfoEmitter(CharactorControl emit_control) { m_CharacterControl = emit_control; emit_mutex = new Mutex(); start = false; emit_wait = false; if (socket == null) { try { GameObject go = GameObject.Find("SocketIO"); socket = go.GetComponent <SocketIOComponent>(); } catch (Exception e) { Debug.Log("Cannot found server interface program!" + e.Message); } } emit_thread = new Thread(new ThreadStart(() => { lock (emit_mutex) { while (true) { while (!start) { Monitor.Wait(emit_mutex); } TaskSystem.getInstance().addTask(() => { EmitData(m_CharacterControl.transform, m_CharacterControl.getJump(), m_CharacterControl.getMoveDirection(), m_CharacterControl.getClouch(), UnityEngine.Time.realtimeSinceStartup); }); emit_wait = true; while (emit_wait) { Monitor.Wait(emit_mutex); } } } })); emit_thread.Start(); }
void Awake() { // 몬스터 추가 SlimeList = new List<GameObject>(); //for (int i = 0; i < MaxSlime; ++i) //{ // //SlimeList.Add(new GameObject()); // SlimeList.Add(null); //} // 몬스터 생성 코루틴 시작 StartCoroutine("SlimeGeneration"); // 플레이어 정보 추출 playerObj = GameObject.Find("PLAYER/Cha_Knight"); player = playerObj.GetComponent<CharactorControl>(); // Find and Set Amount of gold label GoldLabel = GameObject.Find("UI Root/UICam/UIPanel/Amount_of_Gold/Amount").GetComponent<UILabel>(); }
public TryChangePlayerState(CharactorControl controler) { this.controler = controler; }
// Start is called before the first frame update void Start() { contorol = this.GetComponent <CharactorControl>(); }
void Awake () { ChildControl = GetComponentInChildren<CharactorControl>(); TempVector = transform.forward; }