public void OnStart( int playerId ) { mObjectId = playerId; moveController = GetComponent<PlayerMoveController>(); fireController = GetComponent<PlayerFireController>(); chargeController = GetComponent<PlayerChargeTracker>(); }
void Awake() { player = GameObject.FindGameObjectWithTag("Player"); playerhealth = player.GetComponent <PlayerHealth>(); firecon = player.GetComponentInChildren <PlayerFireController>(); Debug.Log(player); }
// Use this for initialization void Start() { player = GameObject.Find("Player"); firecon = player.GetComponentInChildren <PlayerFireController>(); //Image img = Instantiate(image); //img.transform.SetParent(transform.parent.gameObject.transform, false); Debug.Log(firecon); bullets = new Image[firecon.burstNum]; for (int i = 0; i < bullets.Length; i++) { bullets[i] = Instantiate(image); bullets[i].transform.SetParent(transform.parent.gameObject.transform, false); bullets[i].transform.position = transform.position + new Vector3(30, 0, 0) * i - new Vector3(35, 50, 0); } }
public void OnTriggerEnter(Collider other) { PlayerFireController playerFire = other.GetComponent <PlayerFireController>(); if (playerFire) { if (playerFire.m_suckHoldObject != null) { CatchableObject catchObj = playerFire.m_suckHoldObject.GetComponent <CatchableObject>(); if (catchObj) { BaseMonsterBrain monster = catchObj.GetComponent <BaseMonsterBrain>(); if (monster) { monster.OnAssimilation(); } OnCatch(); } } } CatchableObject catchable = other.GetComponent <CatchableObject>(); if (catchable) { BaseMonsterBrain monster = catchable.GetComponent <BaseMonsterBrain>(); if (monster && !monster.IsKnockedOut()) { return; } else if (monster) { monster.OnAssimilation(); } else { Destroy(other.gameObject); } OnCatch(); } }
void Start() { controller = GetComponent <CharacterController>(); fireController = gameObject.GetComponentInChildren <PlayerFireController>(); }