コード例 #1
0
    GuardIndicator createNewGuardIndicator()
    {
        GameObject     newGuardIndicator = Instantiate(GuardIndicatorPrefab, new Vector3(-Screen.width, -Screen.height, 0), Quaternion.Euler(0, 0, 0), hudCanvas);
        GuardIndicator guardIndicator    = newGuardIndicator.GetComponent <GuardIndicator>();

        guardIndicators.Add(guardIndicator);
        return(guardIndicator);
    }
コード例 #2
0
    void setIndicator(bool value)
    {
        GuardIndicator indicator = guard.GuardIndicator;

        switch (value)
        {
        case true:
            guard.GuardIndicator                   = indicatorManager.GetUnusedGuardIndicator();
            guard.GuardIndicator.InUse             = value;
            guard.GuardIndicator.IndicatorLocation = guard.IndicatorLocation;
            break;

        case false:
            guard.GuardIndicator.InUse             = value;
            guard.GuardIndicator.IndicatorLocation = null;
            guard.GuardIndicator.MoveOffScreen();
            guard.GuardIndicator = null;
            break;
        }
    }