Exemplo n.º 1
0
    void Awake()
    {
        if (Toolbox._instance != null)
        {
            Destroy(this.gameObject);
        }

        manager = GameObject.FindGameObjectWithTag("Manager");

        if (manager != null)
        {
            Debug.Log(manager);
        }
        gameManager = manager.GetComponent <GameworldManager>();
        inventory   = manager.GetComponent <Inventory>();
        equip       = manager.GetComponent <EquipManager>();
        eInventory  = manager.GetComponent <EnemyInventory>();
        stats       = manager.GetComponent <StatsManager>();

        if (manager == null)
        {
            var go = new GameObject("Manager");
            go.transform.parent = this.gameObject.transform;
            go.AddComponent <StatsManager>();
            go.AddComponent <GameworldManager>();
            go.AddComponent <Inventory>();
            go.AddComponent <EquipManager>();
            go.AddComponent <EnemyInventory>();
            go.AddComponent <SavePlayerPrefs>();
        }
    }
Exemplo n.º 2
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     AssignControls();
     HeroInventory.SetUpInventory(GameState.CurrentHero.Inventory);
     EnemyInventory.SetUpInventory(GameState.CurrentEnemy.Inventory, true);
     HeroEquipment.SetUpEquipment(GameState.CurrentHero.Equipment, GameState.CurrentHero.Level, GameState.CurrentHero.Class);
     EnemyEquipment.SetUpEquipment(GameState.CurrentEnemy.Equipment, 0, null, true);
     ToggleLootGold();
 }
Exemplo n.º 3
0
 void Start()
 {
     player    = GameObject.Find("Player");
     rb        = GetComponent <Rigidbody>();
     inventory = GetComponent <EnemyInventory>();
     rend      = GetComponent <SpriteRenderer>();
     dieAction = Die;
     inventory.RegisterDeathCallbacks(dieAction);
 }
Exemplo n.º 4
0
    // Use this for initialization

    void OnEnable()
    {
        inventory = GetComponent <EnemyInventory>();
        rend      = GetComponent <SpriteRenderer>();
        rb        = GetComponent <Rigidbody>();
        dieAction = Die;
        inventory.RegisterDeathCallbacks(dieAction);
        StartCoroutine(GelAnimation());
        StartCoroutine(GelMove());
    }
Exemplo n.º 5
0
 void OnEnable()
 {
     rb        = GetComponent <Rigidbody>();
     rend      = GetComponent <SpriteRenderer>();
     inventory = GetComponent <EnemyInventory>();
     dir       = directions[Random.Range(0, directions.Length)];
     dieAction = Die;
     inventory.RegisterDeathCallbacks(dieAction);
     directionRoutine = StartCoroutine(DirectionAnimations(dir));
     StartCoroutine(GoriyaMove());
 }
Exemplo n.º 6
0
    void OnEnable()
    {
        rb        = GetComponent <Rigidbody>();
        sprite    = GetComponent <SpriteRenderer>();
        inventory = GetComponent <EnemyInventory>();
        dieAction = Die;
        inventory.RegisterDeathCallbacks(dieAction);

        StartCoroutine(StalfosMove());
        StartCoroutine(FlipSprite(animationWait));
    }
Exemplo n.º 7
0
 // Use this for initialization
 void OnEnable()
 {
     rend      = GetComponent <SpriteRenderer>();
     rb        = GetComponent <Rigidbody>();
     inventory = GetComponent <EnemyInventory>();
     StartCoroutine(KeeseSpeedUp());
     StartCoroutine(ChangeDirection());
     StartCoroutine(KeeseAnimation());
     utility   = Camera.main.GetComponent <GameUtilities>();
     dieAction = Die;
     inventory.RegisterDeathCallbacks(dieAction);
 }
Exemplo n.º 8
0
 private void OnEnable()
 {
     rb        = GetComponent <Rigidbody>();
     rend      = GetComponent <SpriteRenderer>();
     utility   = Camera.main.GetComponent <GameUtilities>();
     direction = Vector3.left;
     inventory = GetComponent <EnemyInventory>();
     move      = StartCoroutine(AquamentusMovement());
     anim      = StartCoroutine(AquamentusAnimation());
     dieAction = Die;
     inventory.RegisterDeathCallbacks(dieAction);
 }
Exemplo n.º 9
0
 void OnEnable()
 {
     // TODO: Wallmaster sounds for when you enter/exit the room
     utility        = Camera.main.GetComponent <GameUtilities>();
     rend           = GetComponent <SpriteRenderer>();
     rb             = GetComponent <Rigidbody>();
     player         = GameObject.Find("Player");
     playerAttacked = player.GetComponent <BeingAttacked>();
     inventory      = GetComponent <EnemyInventory>();
     cam            = Camera.main;
     dieAction      = Die;
     inventory.RegisterDeathCallbacks(dieAction);
 }
Exemplo n.º 10
0
    // Start is called before the first frame update
    void Start()
    {
        stats = Toolbox.GetInstance().GetStats().GetComponent <StatsManager>();

        manager = Toolbox.GetInstance().GetManager().GetComponent <GameworldManager>();

        inventory = Toolbox.GetInstance().GetInventory().GetComponent <Inventory>();

        equipManager = Toolbox.GetInstance().GetEquip().GetComponent <EquipManager>();

        eInventory = Toolbox.GetInstance().GeteInventory().GetComponent <EnemyInventory>();

        LoadPrefs();
    }