Esempio n. 1
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Object.Destroy(gameObject);
     }
 }
Esempio n. 2
0
    // Start is called before the first frame update
    void Start()
    {
        isSabotaged = false;
        amountToFix = startingAmountToFix;
        base.Start();

        // Set the task and sabotage marker to the sabotage marker style
        sabotageMarker                    = gameObject.AddComponent <Target>() as Target;
        sabotageMarker.boxText            = "SABOTAGE";
        sabotageMarker.TargetColor        = Color.red;
        sabotageMarker.enabled            = false;
        sabotageMarker.NeedArrowIndicator = false;
        taskMarker.TargetColor            = Color.red;
        taskMarker.boxText                = sabotageTargetText;

        // Get all the required managers
        gameSceneManager = GameObject.Find("/GameSceneManager").GetComponent <GameSceneManager>();
        sabotageManager  = GameObject.Find("/SabotageManager").GetComponent <SabotageManager>();
        timerManager     = GameObject.Find("/TimerManager").GetComponent <TimerManager>();
        votingManager    = GameObject.Find("/VotingManager").GetComponent <VotingManager>();
    }
Esempio n. 3
0
 // private float fillAmount = 1.0f;
 private void OnEnable()
 {
     sabotageManager = GameObject.Find("/SabotageManager").GetComponent <SabotageManager>();
     Sabotageable sabotageable = sabotageManager.sabotageable;
 }