Exemplo n.º 1
0
    void Start()
    {
        audioManager = Audio.instance;
        if (audioManager == null)
        {
            Debug.Log("No found any audio");
        }


        if (!systemDamage)
        {
            systemDamage = GameObject.FindObjectOfType <SystemDamage>();
        }
        rb2d             = GetComponent <Rigidbody2D>();
        local            = GetComponentInParent <Local>();
        hinge            = GetComponentsInChildren <HingeJoint2D>();
        anim             = GetComponentsInChildren <Animator>();
        localPVP         = GetComponentInParent <LocalForPVP>();
        localSur         = GetComponentInParent <LocalForSurvival>();
        ai               = GetComponent <AI>();
        weaponBase       = GetComponentsInChildren <Collider2D>();
        WeaponE          = GetComponent <CreateWeaponE>();
        body             = GetComponentsInChildren <AnimationControllerEnemy>();
        weaponController = GetComponentInChildren <WeaponController>();

        ChangeLayer();
    }
Exemplo n.º 2
0
    IEnumerator waitGetDeath()
    {
        yield return(new WaitForSeconds(.001f));

        if (local)
        {
            local.SendMessage("death");
            local = null;
        }

        if (localPVP)
        {
            localPVP.SendMessage("deathP2");
            localPVP = null;
        }

        if (localSur)
        {
            localSur.SendMessage("death");
            localSur = null;
        }

        systemDamage = null;
        yield return(0);
    }
Exemplo n.º 3
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.LogError("More than one AudioManager in the scene");
     }
     else
     {
         instance = this;
     }
 }
Exemplo n.º 4
0
    void checEnemys()
    {
        if (sumKills >= numberEnemysMapHave) // fix this
        {
            //checkEnemy = true;
            if (system)
            {
                StartCoroutine(waitToSend());
            }
        }

        if (system)
        {
            system.trueDeathAllEnemy = checkEnemy;
            system.secondChange      = secondchange;
        }

        if (system && checkEnemy)
        {
            system = null;
        }
    }