void Awake() { GameObject SenceMain = GameObject.Find("SenceMain"); NetWorkingScript = SenceMain.GetComponent<NetWorking>(); targetPostion = transform.position; animation["Run"].speed = 2f; }
void Awake() { GameObject SenceMain = GameObject.Find("SenceMain"); NetWorkingScript = SenceMain.GetComponent <NetWorking>(); targetPostion = transform.position; animation["Run"].speed = 2f; }
// Use this for initialization void Start() { smoke.emit = true; netWorkingScript = GameObject.Find("SenceMain").GetComponent<NetWorking>(); Ray ray = new Ray(transform.position, transform.forward); RaycastHit hit; Physics.Raycast(ray, out hit, Mathf.Infinity, 1 << 9); finalPosition = hit.point + ray.direction * 2; // Debug.DrawRay(ray.origin, ray.direction*100, Color.green, Mathf.Infinity); }
// Use this for initialization void Start() { smoke.emit = true; netWorkingScript = GameObject.Find("SenceMain").GetComponent <NetWorking>(); Ray ray = new Ray(transform.position, transform.forward); RaycastHit hit; Physics.Raycast(ray, out hit, Mathf.Infinity, 1 << 9); finalPosition = hit.point + ray.direction * 2; // Debug.DrawRay(ray.origin, ray.direction*100, Color.green, Mathf.Infinity); }
private void LoadComponents() { _netWorking = new NetWorking(); _notyfy = new Notyfy(); _drawUI = new DrawUI(); _drawUI.GameHandler = this; _enemy = EnemyGameObject.GetComponent <Enemy>(); _enemyHandler = EnemyGameObject.GetComponent <EnemyHandler>(); _animatorDefeatNotyfy = DefeatNotyfy.GetComponent <Animator>(); _animatorWinNotyfy = WinNotyfy.GetComponent <Animator>(); _rewardAD = GetComponent <RewardAD>(); _enemyHandler.Damage = Damage; TimeHandle.Power(TimeGame); _enemyHandler.Notify += ChangeHealth; TimeHandle.OnChanges += SendNotifyEndTime; _rewardAD.Notify += Reward; if (PlayerPrefs.HasKey("Record")) { Best = PlayerPrefs.GetInt("Record"); } }