コード例 #1
0
 void DropPresent()
 {
     pressie.drop();
     if (pressie.getHouse())
     {
         pressie.getHouse().OnPressieDrop();
     }
     pressie = null;
 }
コード例 #2
0
    void PickupPresent(Pressie pressie)
    {
        pressie.pickUp(this, pressiePoint);
        this.pressie = pressie;

        if (pressie.getHouse())
        {
            pressie.getHouse().OnPressieCollect(this);
        }
    }
コード例 #3
0
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag == "pressie" && pressie == null)
        {
            Pressie p = collision.gameObject.GetComponent <Pressie>();
            if (p.owner != null)
            {
                print("DROP IT!");
                p.owner.DropPresent();
            }

            PickupPresent(p);
        }
    }
コード例 #4
0
    private void OnTriggerEnter(Collider other)
    {
        print("HIT " + other.gameObject);

        if (pressie != null && other.transform.position == pressie.getHouse().transform.position)
        {
            print("IS OUR GUY");
            Pressie thePressie = pressie;
            pressie.getHouse().SatifyGoal();
            DropPresent();
            score += 1;
            onPointScore.Invoke();

            Destroy(thePressie.gameObject);
        }
    }