Ejemplo n.º 1
0
    private void Start()
    {
        rb       = GetComponent <Rigidbody2D>();
        renderer = GetComponent <Renderer>();
        mouth    = GetComponent <MouthController>();

        health = maxHealth;
    }
Ejemplo n.º 2
0
 void Start()
 {
     rb                   = GetComponent <Rigidbody2D> ();
     checkGroundTop       = GameObject.Find(this.name + "/ground_check_top").transform;
     checkGroundBottom    = GameObject.Find(this.name + "/ground_check_bottom").transform;
     attackLocation       = GameObject.Find(this.name + "/AttackLocation").transform;
     mouth                = GameObject.Find(this.name + "/Body/Head/Mouth").GetComponent <MouthController> ();
     landingSmokeLocation = GameObject.Find(this.name + "/LandingSmokeLocation").transform;
     life                 = ApplicationController.ac.playerData.max_life;
 }
Ejemplo n.º 3
0
    private void Start()
    {
        mouth        = GetComponent <MouthController>();
        NavMeshAgent = GetComponent <NavMeshAgent>();
        var list = GetComponentsInChildren <LerpMaterial>();

        foreach (LerpMaterial lerp in list)
        {
            LerpMaterials.Add(lerp);
        }

        pawn = GetComponent <Pawn>();
    }
Ejemplo n.º 4
0
    protected void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            Debug.Log("Hit player!");
            MouthController player = collision.GetComponent <MouthController>();
            if ((player.state == MouthController.MouthState.Open && !goodFood) ||
                (player.state == MouthController.MouthState.Closed && goodFood))
            {
                GameObject.Find("MiniGameManager").GetComponent <MiniGameManager>().OnDefeat();
            }

            if (player.state == MouthController.MouthState.Open)
            {
                Instantiate <GameObject>(particleEffect, this.transform.position - Vector3.up, Quaternion.identity);
                Destroy(this.gameObject);
            }
        }
    }
Ejemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        enteringCannon = false;
        trigger        = false;
        secondsInside  = 0f;
        lerpTime       = 0f;

        startPosition  = transform.localPosition;
        targetPosition = new Vector3(startPosition.x, startPosition.y, 0f);

        mouth = transform.parent.gameObject.GetComponentInChildren <MouthController> ();

        if (null == GetComponent <AudioSource> ())
        {
            audioSource = gameObject.AddComponent <AudioSource> ();
        }
        else
        {
            audioSource = gameObject.GetComponent <AudioSource> ();
        }
    }
Ejemplo n.º 6
0
    void Start()
    {
        goodEats = 0;
        badEats  = 0;

        if (mouthCollider != null)
        {
            MouthController setMouthCollider = mouthCollider.GetComponent <MouthController>();
            setMouthCollider.ManagerObject = gameObject;
        }
        else
        {
            Debug.LogWarning("No Mouth Collider set!");
        }

        if (scoreSlider != null)
        {
            scoreTween = gameScore;
        }
        else
        {
            Debug.LogWarning("No Score Slider set!");
        }
    }
Ejemplo n.º 7
0
 void Awake()
 {
     instance = this;
     animator = gameObject.GetComponent <Animator>();
 }
Ejemplo n.º 8
0
 private void OnEnable()
 {
     m = target as MouthController;
     t = new SerializedObject(target);
 }