public override void Fire() { currentTarget = getTarget(); if (currentTarget != null) { NetworkAnimations netanim = GetComponentInChildren <NetworkAnimations>(); netanim.SetTrigger("Bomb"); networkView.RPC("PlayBombSoundEffect", RPCMode.All); } else { // no valid target, refund pickups var inv = GetComponent <Inventory>(); inv.AddPickUp(PickUpTypes.Weapon); inv.AddPickUp(PickUpTypes.Weapon); } }
public override void Fire() { NetworkAnimations netanim = GetComponentInChildren <NetworkAnimations> (); netanim.SetBool("Melee", true); }
private IEnumerator slam(float seconds) { float sec = seconds; Vector3 direction; DinoCollisions dinoCol = GetComponent <DinoCollisions>(); dinoCol.enabled = false; NetworkAnimations netanim = GetComponentInChildren <NetworkAnimations>(); netanim.SetBool("Melee", true); DinoCollisions otherCol = null; while (sec > 0) { direction = transform.TransformDirection(Vector3.forward); //if(Physics.SphereCastAll(this.transform.position, 5.0f, direction, out hit, 20.0f)); hit = Physics.SphereCastAll(this.transform.position, 10.0f, direction, 20.0f); foreach (RaycastHit _ray in hit) { if (_ray.transform.tag == "Dino" || _ray.transform.tag == "Ai") { otherCol = _ray.transform.GetComponent <DinoCollisions>(); otherCol.enabled = false; if (somethingHit == false) { Debug.Log("hit " + _ray.transform.name); Health health = _ray.transform.GetComponent <Health>(); health.Damage(damage); } somethingHit = true; break; } } if (somethingHit == true) { break; } this.rigidbody.velocity = transform.TransformDirection(Vector3.forward) * speedBoost; sec -= 1 * Time.deltaTime; yield return(new WaitForSeconds(0.01f));; } yield return(new WaitForSeconds(0.5f)); if (otherCol != null) { otherCol.enabled = true; } dinoCol.enabled = true; somethingHit = false; netanim.SetBool("Melee", false); networkView.RPC("DisableVFX", RPCMode.All); }
void Start() { netanim = GetComponentInChildren <NetworkAnimations>(); }
// Use this for initialization void OnEnable() { anim = GetComponentInChildren<Animator>(); // Get the selected dino's mechanim controller netanim = GetComponentInChildren<NetworkAnimations>(); myNormal = Vector3.up; // foreach(Animator obj in transform) // { // anim = obj; // } oldTopSpeed = topSpeed; oldAcceleration = acceleration; TurboTopSpeed = topSpeed * 1.5F; TurboAcceleration = acceleration * 2.0F; velocityJump = Mathf.Sqrt(2.0f * jump * gravity); velocity = rigidbody.velocity.magnitude; }