Beispiel #1
0
    // Start is called before the first frame update
    private void Awake()
    {
        lvlSys = new LevelSystem();
        Debug.Log(lvlSys.GetLevelNumber());
        lvlSys.AddExp(50);
        Debug.Log(lvlSys.GetLevelNumber());
        lvlSys.AddExp(60);
        Debug.Log(lvlSys.GetLevelNumber());

        lvlWin.SetLevelSystem(lvlSys);
    }
Beispiel #2
0
    private void Awake()
    {
        LevelSystem levelSystem = new LevelSystem();

        Debug.Log(levelSystem.getLevelNumber());
        levelSystem.AddExperience(5);
        Debug.Log(levelSystem.getLevelNumber());
        levelSystem.AddExperience(6);
        Debug.Log(levelSystem.getLevelNumber());

        levelWindow.SetLevelSystem(levelSystem);
    }
Beispiel #3
0
    public override void FixedUpdate()
    {
        base.FixedUpdate();

        levelWindow.SetLevelSystem(levelSystem);

        if (inGuntime &&
            !(myState is PlayerGlide) &&
            !(myState is PlayerDodge))
        {
            rb.AddForce(4.5f * Physics.gravity);
        }
    }
Beispiel #4
0
    [SerializeField] private EquipWindow equipWindow; // You are setting the private integer to equip the window //

    // [SerializeField] Serialization is the automatic process of transforming data structures or object states into a format that Unity can store and reconstruct later. //
    // Some of Unity’s built-in features use serialization; features such as saving and loading, the Inspector, window, instantiation and Prefabs //

    private void Awake()                             // Awake is called when the script instance is being loaded. //
    {
        LevelSystem levelSystem = new LevelSystem(); // Awake is called either when an active GameObject that contains the script is initialized when a Scene loads, //

        // or when a previously inactive GameObject is set to active, or after a GameObject created with Object.Instantiate is initialized. //
        // Use Awake to initialize variables or states before the application starts. //
        levelWindow.SetLevelSystem(levelSystem);                                        // You are using levelWindow to set the levelSystem //
        equipWindow.SetLevelSystem(levelSystem);                                        // You are using equipWindow to set the levelSystem //

        LevelSystemAnimated levelSystemAnimated = new LevelSystemAnimated(levelSystem); // In all code, repeating the same variable twice establishes what you're trying to do //

        // That's why it's always necessary to do LevelSystemAnimted levelSystemAnimated //
        levelWindow.SetLevelSystemAnimated(levelSystemAnimated); // In this code, you are using the levelWindow to set the animated level system //
        player.SetLevelSystemAnimated(levelSystemAnimated);      // In this code, you are using the player to trigger the animated level system, as the player is an integer connected to the level system //
    }
Beispiel #5
0
    // Start is called before the first frame update
    private void Start()
    {
        defaultState = new PlayerIdle(this);
        animator     = GetComponent <Animator>();
        // New line
        levelSystem = new LevelSystem();
        levelWindow = GameObject.Find("GameplayCanvas/LevelWindow").GetComponent <LevelWindow>();
        levelWindow.SetLevelSystem(levelSystem);

        if (myState == null)
        {
            myState = defaultState;
            myState.Enter();
        }
        rb = GetComponent <Rigidbody>();
        dodgeAbility.dodgeDuration = -1f;
        MAX_STAMANA = data.remainingStamana;

        healthbar       = GameObject.Find("GameplayCanvas/HealthBar_BG").GetComponent <HealthbarController>();
        stamanaMeter    = GameObject.Find("GameplayCanvas/UIDiamonds/StamanaBar/StamanaBarForeground").GetComponent <Image>();
        skillTreeWindow = GameObject.Find("GameplayCanvas").GetComponent <SkillTreeWindow>();
    }
Beispiel #6
0
    public void InitializeLevelManager()
    {
        XpSystem levelSystem = new XpSystem();

        levelWindow.SetLevelSystem(levelSystem);
    }
Beispiel #7
0
    private void Awake()
    {
        LevelSystem levelSystem = new LevelSystem();

        levelWindow.SetLevelSystem(levelSystem);
    }