コード例 #1
0
ファイル: Spectator.cs プロジェクト: TimothyOneill/GiantROM
    public void Feelings(int _demonstration)
    {
        if (statBar.GetFillamount() != 0.0f)
        {
            if (likes == _demonstration)
            {
                statBar.ChangeBar(0.0035f);
                emotionRenderer.sprite = emotions[0];
            }

            else if (hates == _demonstration)
            {
                statBar.ChangeBar(-0.0035f);
                emotionRenderer.sprite = emotions[1];
            }
            else
            {
                statBar.ChangeBar(-0.0005f);
                emotionRenderer.sprite = emotions[2];
            }

            if (3 == _demonstration) //Silliness.
            {
                fullReset = true;
                emotionRenderer.sprite = emotions[0];
            }
        }
    }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: TimothyOneill/GiantROM
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            SetDemonstration(0);
        }

        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            SetDemonstration(1);
        }

        if (Input.GetKeyDown(KeyCode.Alpha3))
        {
            SetDemonstration(2);
        }

        //Set new target for spotlight
        if (spotlight.ReachedTarget())
        {
            spotlight.SetTarget(new Vector3(Random.Range(-10, 10), spotlight.transform.position.y, spotlight.transform.position.z));
            spotlight.SetSpeed(Random.Range(0.1f, 0.9f));
        }

        //Check if the player is in the spotlight if not drop approval.
        if (spotlight.InSpotLight(GameObject.Find("Dan").transform.position))
        {
            powerBar.ChangeBar(0.001f);
        }
        else
        {
            powerBar.ChangeBar(0);
        }

        cooldown -= 0.01f;

        if (cooldown < 0)
        {
            t.text = "";
        }

        if (powerBar.GetFillamount() == 1)
        {
            instructions.text = "PRESS 4";
        }
        else
        {
            instructions.text = "";
        }
    }