コード例 #1
0
    public void Resetami()
    {
        if (gameObject.tag == "Player")
        {
            Debug.Log("in player loop");

            //	GameObject l = GameObject.FindGameObjectWithTag("lobbies");

            amiController a1 = gameObject.transform.GetComponent <amiController>();
            if (a1 != null)
            {
                a1.isdead = false;
            }
            anic1m a2 = gameObject.transform.GetComponent <anic1m>();
            if (a2 != null)
            {
                a2.isdead = false;
            }


            PlayerInput pi = gameObject.transform.GetComponent <PlayerInput>();
            Debug.Log("before" + pi.isdead);
            pi.isdead = false;
            Debug.Log("skdlfjlsd" + pi.isdead);
            p = gameObject.transform.GetComponent <Player>();

            p.isfired(false);
        }

        if (gameObject.tag == "Enemy")
        {
            anc2m a2m = gameObject.transform.GetComponent <anc2m>();
            if (a2m != null)
            {
                a2m.isdead = false;
            }
            anict2f an2f = gameObject.transform.GetComponent <anict2f>();
            if (an2f != null)
            {
                an2f.isdead = false;


                //networkView.RPC ("respawn", RPCMode.All);
            }


            PlayerInput pi = gameObject.transform.GetComponent <PlayerInput>();
            pi.isdead = false;
            PlayerBlue p = gameObject.transform.GetComponent <PlayerBlue>();

            p.isfired(false);
        }
    }
コード例 #2
0
    void Die()
    {
        GameObject g = GameObject.Find("GameManger");

        if (gameObject.tag == "Player")
        {
            Debug.Log("in player loop");

            //	GameObject l = GameObject.FindGameObjectWithTag("lobbies");

            amiController a1 = gameObject.transform.GetComponent <amiController>();
            if (a1 != null)
            {
                a1.isdead = true;
            }
            anic1m a2 = gameObject.transform.GetComponent <anic1m>();
            if (a2 != null)
            {
                a2.isdead = true;
            }


            PlayerInput pi = gameObject.transform.GetComponent <PlayerInput>();
            Debug.Log("before" + pi.isdead);
            pi.isdead = true;
            Debug.Log("skdlfjlsd" + pi.isdead);
            p = gameObject.transform.GetComponent <Player>();

            p.isfired(true);
        }

        if (gameObject.tag == "Enemy")
        {
            anc2m a2m = gameObject.transform.GetComponent <anc2m>();
            if (a2m != null)
            {
                a2m.isdead = true;
            }
            anict2f an2f = gameObject.transform.GetComponent <anict2f>();
            if (an2f != null)
            {
                an2f.isdead = true;


                //networkView.RPC ("respawn", RPCMode.All);
            }


            PlayerInput pi = gameObject.transform.GetComponent <PlayerInput>();
            pi.isdead = true;
            PlayerBlue p = gameObject.transform.GetComponent <PlayerBlue>();

            p.isfired(true);
        }


        StartCoroutine(Wait());



//			}
    }