コード例 #1
0
    // TELEPORTS THE PLAYER TO THE OPOSITE PORTAL //
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player") && isClosed == false)
        {
            OnPortalActivated.Raise();
            FieldEventManager.ChangeField(ElementType);
            GameObject go = Instantiate(PortalExplodeEffect, (this.transform));
            go.transform.localPosition += Offset;

            //TO DO: VISUAL LOCKING OF THE PORTALS!!!
            other.attachedRigidbody.MovePosition(teleportPad.position);
            other.GetComponent <UnitHealthController>().Energize(6);

            isClosed = true;
            isUsed   = true;
            //  PortalManager.LockPortals();
            //PortalManager.PortalTriggered(this.FieldType);
        }
    }
コード例 #2
0
 public Field(int fieldID)
 {
     FieldID      = fieldID;
     EventManager = new FieldEventManager(this);
 }
コード例 #3
0
 public Field()
 {
     EventManager = new FieldEventManager(this);
 }