Пример #1
0
 public void RealThrow()
 {
     if (grabbedObject != null)
     {
         grabbedObject.transform.SetParent(transform.parent);
         grabbedObject.transform.localRotation = Quaternion.identity;
         grabbedObject.Throw();
         grabbedObject = null;
     }
 }
Пример #2
0
 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;
         }
     }
 }
Пример #3
0
 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;
         }
     }
 }
Пример #4
0
 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();
 }
Пример #5
0
 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);
     }
 }