Exemple #1
0
    // Cube got Hit
    // return 'false' when cube was destroyed
    public bool Hit(int hitDamage)
    {
        mCubeHealth -= hitDamage;
        if (mCubeHealth >= 0 && mIsAlive)
        {
            StartCoroutine(DestroyCube());

            SpawnScript s = new SpawnScript();
            s.SpawnElement();

            return(true);
        }
        return(false);
    }