public void OnPlayerCharacterDie(CPlayerCharacter Character) { if (EControllerType.Player1 == Character.controller_type) { SceneManager.LoadScene("Lobby"); } }
public override bool FindNearestTarget() { if (TargetObj) { return(true); } bool bFinded = false; float CheckTargetDist = 100.0f; Vector3 CurPos = gameObject.transform.position; GameObject[] FindObjs = GameObject.FindGameObjectsWithTag("PlayerCharacter"); foreach (GameObject FindObj in FindObjs) { CPlayerCharacter FindChar = FindObj.GetComponent <CPlayerCharacter>(); if (FindChar.curState != EState.Die) { float TargetDist = Vector3.Distance(FindObj.transform.position, CurPos); if (TargetDist < CheckTargetDist && TargetDist <= EyeSight) { CheckTargetDist = TargetDist; TargetObj = FindObj; bFinded = true; } } } return(bFinded); }
public void Init(CPlayerCharacter character) { _character = character; Transform anim = _character.transform.GetChild(0); _spirte = anim.GetComponent <SpriteRenderer>(); _animator = anim.GetComponent <Animator>(); }
public void OnPlayerCharacterHit(CPlayerCharacter Character) { if (EControllerType.Player1 == Character.controller_type) { } }
public override void Init(CUnit character) { base.Init(character); _character = character as CPlayerCharacter; }
private void Awake() { _speed = 0.05f; _character = GameObject.Find("Player").GetComponent <CPlayerCharacter>(); }
public void SetController(CPlayerCharacter character) { _character = character; _character.Init(this); }