コード例 #1
0
ファイル: Player.cs プロジェクト: AjayLiu/all-unity-games
    public void GetSoda()
    {
        if (CurrentCleanCupTray != null)
        {
            audio.PlayOneShot(Mug, 0.3f);
            Debug.Log("Did");
            var cup = CurrentCleanCupTray.TakeCup();
            this.Cup = cup;
            cup.transform.SetParent(this.Hand.transform);
            cup.transform.localPosition    = Vector3.zero;
            cup.transform.localEulerAngles = Vector3.zero;

            CurrentCleanCupTray = null;
            Debug.Log("SettoNull");
        }
        else if (CurrentSodaMachine != null)
        {
            TakeCup(CurrentSodaMachine.TakeCup());
            CurrentSodaMachine = null;
        }
        else
        {
            print("else");
            TakeCup(AccessingCounter.GetDirtyCup());
            AccessingCounter = null;
        }
    }
コード例 #2
0
ファイル: Player.cs プロジェクト: AjayLiu/all-unity-games
    public void GiveCup()
    {
        CurrentCleanCupTray = null;
        if (CurrentSodaMachine != null)
        {
            audio.PlayOneShot(Mug);
            CurrentSodaMachine.PutCups(Cup);
            this.Cup = null;
        }

        else if (AccessingCounter != null)
        {
            audio.PlayOneShot(Mug);
            AccessingCounter.PutCups(Cup);
            Cup = null;
        }
        else if (CurrentDirtyCupTray != null)
        {
            CurrentDirtyCupTray.PutCups(Cup);
            Cup = null;
        }
    }