Beispiel #1
0
    public void Start()
    {
        health_bar = new HealthSystem(HealthBarDimens, VerticleHealthBar, HealthBubbleTexture, HealthTexture, HealthBubbleTextureRotation);
        exp_bar = new ExperienceSystem(ExpBarDimens, VerticleExpBar, ExpBubbleTexture, ExperienceTexture, ExpTextureRotation);
        mana_bar = new ManaSystem(ManaBarDimens, ManaBarScrollerDimens, VerticleManaBar, ManaBubbleTexture, ManaTexture, ManaBubbleTextureRotation);

        exp_bar.Initialize();
        health_bar.Initialize();
        mana_bar.Initialize();
    }
Beispiel #2
0
    void Start()
    {
        if (ManabarTexture == null) Debug.LogError("Please assign a GUITexture for the mana bar in the Editor.");

        if (instance == null)
        {
            instance = GameObject.FindObjectOfType(typeof(ManaSystem)) as ManaSystem;

            if (instance == null)
            {
                GameObject obj = new GameObject("ManaManager");
                instance = obj.AddComponent<ManaSystem>();
                DontDestroyOnLoad(obj);
            }
        }

        // Register to CognitivEvents (to make the manasystem the owner of events, we should have
        // CognitivSkillEvent passed to here and have this post (if there is enough mana) the proper
        // skill events.
        NotificationCenter.DefaultCenter.AddObserver(this, "OnCognitivEvent");
        NotificationCenter.DefaultCenter.AddObserver(this, "OnEmotionEvent");

        // Set currentMana to be whatever player has
        player = GameState.Instance.getCurrentPlayer();

        if (player != null)
            currentMana = player.Mana <= maxMana ? player.Mana : maxMana;
        else
        {
            currentMana = minMana;
        }

        // Set ManabarTexture to correct size
        Rect textureRect = ManabarTexture.pixelInset;
        textureRect.xMax = ManabarTexture.pixelInset.xMin + ManabarGUIWidth * currentMana;
        ManabarTexture.pixelInset = textureRect;
        Debug.Log("ManaSystem: textureRect.xMax = " + textureRect.xMax + " with Mana: " + currentMana);

        currentTime = Time.time;
        endTime = currentTime + 1.0f;
    }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     manaSystem   = GameObject.Find("SkillBoard").GetComponent <ManaSystem>();
     undeadSummon = gameObject.GetComponent <SummonUndeadSystem>();
 }
 public void Get_ManaSystem()
 {
     Ms = GameObject.Find("ManaSystem").GetComponent <ManaSystem>();
 }
Beispiel #5
0
 private void Start()
 {
     currentMagic = 0;
     Load();
     playerMS = PlayerManager.instance.player.GetComponent <ManaSystem>();
 }