Example #1
0
 void Awake()
 {
     game = FindObjectOfType<GameController>();
     body = GetComponent<Rigidbody>();
     gravity = GetComponent<VariableGravity>();
     destroy = GetComponent<PortalDestroy>();
 }
Example #2
0
 public bool affects(VariableGravity test)
 {
     if (!isActive())
         return false;
     else
     {
         foreach (VariableGravity g in affected)
             if (g == test)
                 return true;
         return false;
     }
 }
Example #3
0
    void Awake()
    {
        initialPos = transform.position;
        initialRot = transform.rotation;
        portals = FindObjectsOfType<PortalDoor>();
        game = FindObjectOfType<GameController>();
        body = GetComponent<Rigidbody>();
        gravity = GetComponent<VariableGravity>();

        if (portals.Length == 0)
            enabled = false;
    }