// Use this for initialization void Start() { pController = GameObject.Find("GameManager").GetComponent <OfflineGameController>(); Debug.Assert(pController != null); anim = GetComponent <PlayerAnimOffline>(); Debug.Assert(anim != null); attack1 = false; attack2 = false; canBlock = false; canSpawnBreakingBlockEffect = false; pData = GetComponent <PlayerData>(); Debug.Assert(pData != null); blockingEffect.SetActive(false); Debug.Assert(blockingEffect != null); breakBlockingEffect.SetActive(false); Debug.Assert(breakBlockingEffect != null); if (mobileMode) { attackButton1 = GameObject.Find("AttackButton1").GetComponent <Button>(); Debug.Assert(attackButton1 != null); attackButton2 = GameObject.Find("AttackButton2").GetComponent <Button>(); Debug.Assert(attackButton2 != null); attackButton1.onClick.AddListener(Attack1); attackButton2.onClick.AddListener(Attack2); } }
// Use this for initialization void Start() { anim = GetComponent <PlayerAnimOffline>(); Debug.Assert(anim != null); playerData = GetComponent <PlayerData>(); Debug.Assert(playerData != null); pAttack = GetComponent <PlayerAttackOffline>(); Debug.Assert(pAttack != null); pController = GameObject.Find("GameManager").GetComponent <OfflineGameController>(); Debug.Assert(pController != null); }