// Use this for initialization
    void Start()
    {
        dungeonCanvas          = GameObject.Find("Dungeon");
        buttonForAtackCharging = GameObject.Find("ChargeAtackButton");
        objectSelector         = dungeonCanvas.GetComponent <ObjectSelector>();
        dungeonManager         = dungeonCanvas.GetComponent <DungeonManager>();
        displayParty           = dungeonCanvas.GetComponent <DisplayParty>();
        dungeonsGenerator      = dungeonCanvas.GetComponent <DungeonsGenerator>();
        fightMode = dungeonCanvas.GetComponent <FightMode>();
        buttonForAtackCharging.SetActive(false);
        buttonIsHeld      = false;
        chargeReachedPeak = false;
        speedTimer        = 0;
        randomNumber      = new System.Random();

        filePath      = "UI_Elements/";
        typeOfElement = new string[] { "ChargeBar", "ChargeBarPointer" };

        if (GameObject.Find("FactoryObject") == null)
        {
            factoryObject       = new GameObject();
            factoryObject.name  = "FactoryObject";
            factoryObject.layer = 0;
            factoryObject.AddComponent <SpriteRenderer>();
            Debug.Log("ButtonForChargingAtack || Start || Created new FactoryObject");
        }
        else
        {
            Debug.Log("ButtonForChargingAtack || Start || Found FactoryObject");
            factoryObject = GameObject.Find("FactoryObject");
        }

        initializeChargeBar();
        loadChargeBarSize();
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     escapeButton = GameObject.Find("ButtonForEscape");
     dungeon      = GameObject.Find("Dungeon");
     displayParty = dungeon.GetComponent <DisplayParty>();
     escapeButton.GetComponent <Button>().onClick.AddListener(escapeFromFight);
     randomNumber      = new System.Random();
     dungeonsGenerator = dungeon.GetComponent <DungeonsGenerator>();
     fightMode         = dungeon.GetComponent <FightMode>();
     escapeButton.SetActive(false);
 }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     dungeonCanvas           = GameObject.Find("Dungeon");
     fightMode               = dungeonCanvas.GetComponent <FightMode>();
     dungeonManager          = dungeonCanvas.GetComponent <DungeonManager>();
     dungeonsGenerator       = dungeonCanvas.GetComponent <DungeonsGenerator>();
     buttonForCameraMovement = dungeonCanvas.GetComponent <ButtonForCameraMovement>();
     enemyObjectsArray       = new List <FightModeObject>();
     heroObjectsArray        = new List <FightModeObject>();
     tempObject              = new GameObject();
     createMasksForHighlight();
 }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     dungeonCanvas              = GameObject.Find("Dungeon");
     dungeonManager             = dungeonCanvas.GetComponent <DungeonManager>();
     dungeonsGenerator          = dungeonCanvas.GetComponent <DungeonsGenerator>();
     enemyGenerator             = dungeonCanvas.GetComponent <EnemyGenerator>();
     buttonForCameraMovement    = GameObject.Find("MoveRightButton").GetComponent <ButtonForCameraMovement>();
     buttonForUsage             = GameObject.Find("UseButton").GetComponent <ButtonForUsage>();
     objectSelector             = dungeonCanvas.GetComponent <ObjectSelector>();
     displayParty               = dungeonCanvas.GetComponent <DisplayParty>();
     partyIsInFightMode         = false;
     enemyPossitionsBeforeFight = new float[4];
     colidedWithPartyNumber     = 0;
 }
    public void Start()
    {
        dungeonCanvas    = GameObject.Find("Dungeon");
        dungeonGenerator = dungeonCanvas.GetComponent <DungeonsGenerator>();
        buttonForUsage   = GameObject.Find("UseButton").GetComponent <ButtonForUsage>();
        isFacingRight    = true;

        heroesObjects = new List <GameObject>();

        for (int i = 0; i < sizeOfParty; i++)
        {
            heroesObjects.Add(GameObject.Find("HeroObject" + (i + 1).ToString()));
        }

        focusedHeroPosition = heroesObjects[0].transform.position.x;
    }
Beispiel #6
0
 // Use this for initialization
 void Start()
 {
     wasTransitionCalled   = false;
     shouldButtonsBeLocked = false;
     //We will always start on level 0
     currentCorridorId   = 0;
     previousCorridorId  = currentCorridorId;
     dungeonCanvas       = GameObject.Find("Dungeon");
     dungeonGenerator    = dungeonCanvas.GetComponent <DungeonsGenerator>();
     dungeonManager      = dungeonCanvas.GetComponent <DungeonManager>();
     currentCorridor     = dungeonManager.getLevelsArray().Find(x => x.getIdOfLevel() == currentCorridorId);
     focusedHero         = GameObject.Find("HeroObject1");
     chooseCorridor      = GameObject.Find("ChooseCorridorPopup").GetComponent <ChooseCorridor>();
     focusedHeroPosition = focusedHero.transform.position.x;
     useButton.onClick.AddListener(doorTransition);
     objectForDarkening         = GameObject.Find("Transition");
     objectForDarkeningRenderer = objectForDarkening.GetComponent <SpriteRenderer>();
     shouldApplyTransition      = false;
     alphaColor = objectForDarkening.GetComponent <SpriteRenderer>().material.color;
     speedTimer = 0;
     objectForDarkeningRenderer.material.color = new Color(1.0f, 1.0f, 1.0f, 0.0f);
 }