コード例 #1
0
    IEnumerator Screen_launch()
    {
        yield return(new WaitForSeconds(1f));

        RageManager rageManager = GameObject.Find("Canvas").GetComponent <RageManager>();

        rageManager.Sceen();
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        for (int i = 0; i < 2; i++)
        {
            weapon [i] = DataController.SearchID(0);
        }

        rigidBody = GetComponent <Rigidbody>();
        animator  = GetComponentInChildren <Animator> ();
        sprite    = GetComponentInChildren <SpriteRenderer> ();
        colorS    = sprite.color;

        ragemanager = GameObject.Find("Canvas").GetComponent <RageManager>();
        ragemanager.SetWeapon(weapon[actualWeapon].Getname(), weapon[actualWeapon].GetpathSprWeapon(), weapon[actualWeapon].GetidSprWeapon(), ID);
        gameController   = GameObject.Find("GameController").GetComponent <GameController>();
        player_text.text = "<" + gameController.GetName(ID) + ">";
        player_text.transform.position = GetComponent <Transform> ().position + new Vector3(0f, 3f, 1.5f);
    }
コード例 #3
0
    //public AudioSource audio;

    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Obstacle")
        {
            Explosion();
        }
        if (other.gameObject.tag == "Player")
        {
            PlayerController playerController = other.GetComponentInParent <PlayerController> ();
            Shot             shot             = GetComponentInParent <Shot> ();

            if (playerController.GetID() != shot.GetSource())
            {
                Vector3     direction   = shot.GetComponent <Rigidbody>().velocity.normalized;
                RageManager ragemanager = GameObject.Find("Canvas").GetComponent <RageManager>();

                playerController.GetHit(direction, shot.GetID());
                Explosion();
                ragemanager.AddRage(shot.GetID(), shot.GetSource());
            }
        }
    }
コード例 #4
0
 // Start is called before the first frame update
 void Awake()
 {
     instance = this;
 }