// Use this for initialization void Start() { ps = gameObject.GetComponent<PlayerStats> (); sc = gameObject.GetComponent<StateController> (); tpb = gameObject.GetComponent<TestPlayerBehaviour> (); buffSetup (); }
void Update() { tpb = this.gameObject.GetComponentInParent<TestPlayerBehaviour> (); sc = this.gameObject.GetComponentInParent<StateController> (); if ((Time.time - lastUsed) >= gameObject.GetComponentInParent<PlayerStats> ().tailSlapCooldown) { available = true; } if (Input.GetKeyDown (tpb.tailSlapKey) && !sc.isStunned && !sc.isChanneling && !sc.isDead) { var evnt = TailAnimEvent.Create(Bolt.GlobalTargets.Everyone); evnt.TargEnt = GetComponentInParent<TestPlayerBehaviour>().entity; evnt.Send(); // GetComponentInParent<TestPlayerBehaviour> ().animation.Play ("M_TS"); } }
void Update() { tpb = this.gameObject.GetComponentInParent<TestPlayerBehaviour> (); if ((Time.time - lastUsed) >= gameObject.GetComponentInParent<PlayerStats> ().cprCooldown) { available = true; } tpb = this.gameObject.GetComponentInParent<TestPlayerBehaviour> (); if (Input.GetKeyDown (tpb.cprKey)) { if (available && !GetComponentInParent<StateController>().isDead && !GetComponentInParent<StateController>().isStunned && !GetComponentInParent<StateController>().isChanneling && GetComponentInParent<StateController>().canMove) { // BoltEntity self = this.GetComponentInParent<TestPlayerBehaviour>().entity; // int resources = this.gameObject.GetComponentInParent<PlayerStats> ().cprBananas; // using (var evnt = CprEvent.Create(Bolt.GlobalTargets.Everyone)) { // evnt.TargEnt = self; // } available = false; // this.gameObject.GetComponentInParent<PlayerStats> ().cprBananas--; IEnumerator entities = BoltNetwork.entities.GetEnumerator (); //int teammates = 0; //BoltEntity self = this.GetComponentInParent<TestPlayerBehaviour>().entity; while (entities.MoveNext()) { if (entities.Current.GetType ().IsInstanceOfType (new BoltEntity ())) { BoltEntity be = (BoltEntity)entities.Current as BoltEntity; // Create Event and use the be, if it is the one that is colliding. if (be.isOwner) { var evnt = CprEvent.Create(Bolt.GlobalTargets.Everyone); evnt.TargEnt = GetComponentInParent<TestPlayerBehaviour>().entity; evnt.Send(); available = false; this.gameObject.GetComponentInParent<PlayerStats> ().cprBananas--; } if (be.gameObject == this.gameObject.GetComponentInParent<PlayerStats> ().gameObject) { } } } } } }
void start() { sc = this.gameObject.GetComponentInParent<StateController> (); ps = this.gameObject.GetComponentInParent<PlayerStats> (); tpb = this.gameObject.GetComponentInParent<TestPlayerBehaviour> (); }
void start() { tpb = this.gameObject.GetComponentInParent<TestPlayerBehaviour> (); }