Inheritance: MonoBehaviour
Ejemplo n.º 1
0
    public void TakeDamage(float amount)
    {
        if (isDamaged == false)
        {
            HP -= amount;
            SetHPBar();
            animator.SetTrigger("Damage");
            StartCoroutine(cS.Shake(.05f, .04f));
            isDamaged = true;
        }
        //SetHPBar();

        if (HP <= 0)
        {
            isdashing = true;
            SoundManagerScript.PlaySound(SoundManagerScript.die);
            FL = GameObject.FindObjectOfType <FinishLevel>();
            StartCoroutine(cS.Shake(.06f, .05f));
            isDead = true;
            Cs     = GameObject.FindObjectOfType <ChangeScene>();
            if (Cs.LevelToLoad == "Dungeon5" || Cs.LevelToLoad == "BossDungeon")
            {
                Cs.LoadScene(Cs.LevelToLoad);
            }
            else
            {
                FL.LevelEnd();
            }
        }
    }
Ejemplo n.º 2
0
 void Start()
 {
     rb     = GetComponent <Rigidbody2D>();
     FL     = GameObject.FindObjectOfType <FinishLevel>();
     Ps     = GameObject.FindObjectOfType <PlayerScript>();
     player = GameObject.FindGameObjectWithTag("Player").transform;
     E_H    = GetComponentInChildren <Enemy_HP>();
 }
Ejemplo n.º 3
0
 public void Start()
 {
     endPoint    = GameObject.FindGameObjectWithTag("Finish").GetComponent <FinishLevel>();
     collectable = GameObject.FindGameObjectsWithTag("Coin");
     enemies     = GameObject.FindGameObjectsWithTag("Enemy");
     sceneLoader = GameObject.Find("SceneLoader").GetComponent <SceneLoader>();
     player      = GameObject.Find("Player").GetComponent <PlayerController>();
     guiGame     = GameObject.FindGameObjectWithTag("GUI").GetComponent <GUIManager>();
 }
Ejemplo n.º 4
0
 void Start()
 {
     playerscript     = GameObject.FindGameObjectWithTag("Player").GetComponent <MCMovement>();
     textbox          = (IntroText)Object.FindObjectOfType(typeof(IntroText));
     controltower     = (ControlTowerScript)Object.FindObjectOfType(typeof(ControlTowerScript));
     hangerdoorscript = (HangarDoor)Object.FindObjectOfType(typeof(HangarDoor));
     inventparent     = (InventParent)Object.FindObjectOfType(typeof(InventParent));
     finishlevel      = (FinishLevel)Object.FindObjectOfType(typeof(FinishLevel));
 }
Ejemplo n.º 5
0
    private FinishLevel finishLevel; //Reference to script on UI GameObject

    #endregion Fields

    #region Methods

    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        finishLevel = GameController.Instance.showPanels.GetComponent<FinishLevel> ();
    }
Ejemplo n.º 6
0
 void Start()
 {
     Cs = GameObject.FindObjectOfType <ChangeScene>();
     Ps = GameObject.FindObjectOfType <PlayerScript>();
     FL = GameObject.FindObjectOfType <FinishLevel>();
 }
Ejemplo n.º 7
0
 private void Awake()
 {
     Jet         = (DestroyJet)Object.FindObjectOfType(typeof(DestroyJet));
     levelfinish = (FinishLevel)Object.FindObjectOfType(typeof(FinishLevel));
 }