Esempio n. 1
0
 void OnCollisionStay2D(Collision2D col)
 {
     if (col.gameObject.GetComponent <NewPlayer> () != null)
     {
         NewPlayer.Instance.groundType = groundType.ToString();
         NewPlayer.Instance.SetGroundType();
     }
     else if (col.gameObject.GetComponent <EnemyBase> () != null)
     {
         col.gameObject.GetComponent <EnemyBase>().groundType = groundType.ToString();
         col.gameObject.GetComponent <EnemyBase>().SetGroundType();
     }
 }
    private void Swallow()
    {
        GroundType typeSwallowed = tongueCollider.Swallow();

        Debug.Log("Swallowed: " + typeSwallowed.ToString());

        if (typeSwallowed == GroundType.poison)
        {
            bossScript.atePoison = true;
        }

        if (typeSwallowed == GroundType.dirt)
        {
            bossScript.ateRock = true;
        }

        tongueAnimator.gameObject.SetActive(false);
        tongueAnimator.SetFloat("TongueExtendDirection", 1.0f);
        tongueAimIndicator.SetActive(false);

        if (typeSwallowed != GroundType.none)
        {
            AudioManager.Instance.PlaySoundVaried("gulp");
        }
    }
Esempio n. 3
0
        public FieldTile(GroundType gt, Random rnd)
        {
            this.type = gt;
            string adress         = "../Assets/Sprites/GroundTiles/tile_" + gt.ToString(),
                   default_adress = "../Assets/Sprites/GroundTiles/tile_default0.PNG";

            try
            {
                img = new Bitmap(adress + rnd.Next(3).ToString() + ".PNG");
            }
            catch (Exception e)
            {
                img = new Bitmap(default_adress);
            }
        }
Esempio n. 4
0
    public void Swallow()
    {
        isRetracting = false;

        GroundType typeSwallowed = tongueCollider.Swallow();

        Debug.Log("Enemy swallowed: " + typeSwallowed.ToString());

        if (typeSwallowed == GroundType.poison)
        {
            AudioManager.Instance.PlaySoundVaried("RockDestroy");
            Destroy(this.gameObject);
            return;
        }
        else if (typeSwallowed != GroundType.none)
        {
            AudioManager.Instance.PlaySoundVaried("gulp");
        }

        tongueCollider.gameObject.SetActive(false);
    }