Пример #1
0
    //This script unlocks a door when called by an NPC...
    void OnEnable()
    {
        if(!alreadyEnabledOnce){
            alreadyEnabledOnce = true;
            gateController = GetComponent<GateController> ();
            gateController.ActivateGate ();

            //if there is a chained action...
            if(targetGO){
                (targetGO.GetComponent(scriptNameToEnable) as MonoBehaviour).enabled = true;
            }
        }
    }