Ejemplo n.º 1
0
    public void ActivateWarning()
    {
        // TODO: I should be initialised by a lifecycle method before I'm called
        if (firer == null || cam == null)
        {
            Initialise();
        }
        warningActive = true;

        var(intersection, found) = GetWarningPosition();
        if (found)
        {
            warning = Instantiate(warningTemplate, intersection, Quaternion.identity);
        }
        else
        {
            warning = Instantiate(warningTemplate, transform.position, Quaternion.identity);
        }

        warningVisible = true;

        timer            = GameObject.FindObjectOfType <GlobalTimer>();
        timerStopwatchId = timer.AddStopwatch(this);
    }