コード例 #1
0
        void Rpc_setCanMove()
        {
            if (canMove == true)
            {
                canMove = false;
                if (this.isLocalPlayer)
                {
                    IndicatorText indText = (IndicatorText)textBox.GetComponent(typeof(IndicatorText));
                    indText.Caught();
                }
                print(canMove);
                //start particle effect
                Instantiate(catchParticle, this.gameObject.GetComponent <Transform>().position, Quaternion.identity);
                ParticleSystem ps = catchParticle.GetComponent <ParticleSystem>();
                ps.Play(true);
                //TextMeshPro textmeshPro = textMeshP.GetComponent<TextMeshPro>();
                //textmeshPro.SetText("Rabbits killed: 100");
                this.gameObject.GetComponent <Transform>().position = respawn.transform.position;
                StartCoroutine(ExecuteAfterTime(5));
            }

            //this.gameObject.GetComponent<Transform>().position = respawn.gameObject.GetComponent<Transform>().position;
            //hardcoding a pos for now, in the future, change to an object
        }
コード例 #2
0
ファイル: HoldItems.cs プロジェクト: dijour/gardenheist
 void Start(){
     indText = (IndicatorText) textBox.GetComponent(typeof(IndicatorText));
     textMeshP = GameObject.Find("NumRabbitsKilled");
     isLocal = this.isLocalPlayer;
 }