public void RealThrow() { if (grabbedObject != null) { grabbedObject.transform.SetParent(transform.parent); grabbedObject.transform.localRotation = Quaternion.identity; grabbedObject.Throw(); grabbedObject = null; } }
public void addSub(ThrowableSkinnedObject sub) { for (int i = 0; i < subChars.Length; ++i) { if (subChars[i] == null) { subChars[i] = sub; subChars[i].transform.localRotation = Quaternion.AngleAxis(90f, Vector3.up); subChars[i].baseX = -7f; subChars[i].MoveTo(-((1 + i) * CHAR_DISTANCE)); subChars[i].transform.localPosition = new Vector3(-7f, 0, 0); break; } } }
void OnTriggerEnter(Collider tCollider) { if (_invincible) { return; } if (tCollider.tag == "Player" && tCollider.gameObject.layer == 11) { ThrowableSkinnedObject tObj = tCollider.gameObject.GetComponent <ThrowableSkinnedObject>(); if (tObj && tObj.isThrowed) { boss.hitted(tObj.dir, collisionName); timer = 0.05f; } } }
public void RealGrab() { grabbedObject = subChars[0]; for (int i = 0; i < subChars.Length - 1; ++i) { subChars[i] = subChars[i + 1]; if (subChars[i] != null) { subChars[i].MoveTo(-((1 + i) * CHAR_DISTANCE)); } } subChars[subChars.Length - 1] = null; grabbedObject.transform.SetParent(handTransform); grabbedObject.transform.localRotation = Quaternion.identity; grabbedObject.transform.localPosition = new Vector3(0, -0.5f, 0); grabbedObject.Grabbed(); }
void ThrowFailed() { if (grabbedObject != null) { grabbedObject.transform.SetParent(transform.parent); if (grabbedObject.transform.position.y < 0) { Vector3 pos = grabbedObject.transform.position; pos.y = 0; grabbedObject.transform.position = pos; } grabbedObject.ThrowFailed(); grabbedObject = null; } if (animator.GetBool("grab")) { animator.SetBool("grab", false); } }