Beispiel #1
0
 //locate and cache a pointer to the resource manager
 void updateReferences()
 {
     overlord = GameObject.FindGameObjectWithTag("master").GetComponent <Overlord>();
     resCore  = overlord.resourceCore;
     itemMagr = overlord.resourceCore.itemSlice;
     resMgr   = resCore.resourceSlice;
     pls      = overlord.requestPlayerList();
 }
Beispiel #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 7243;
         hash = hash * 92821 + Resource.GetHashCode();
         hash = hash * 92821 + ResourceSlice.GetHashCode();
         hash = hash * 92821 + ActivitySlice.GetHashCode();
         return(hash);
     }
 }
Beispiel #3
0
    [SerializeField] Color fadeToColor;                                         //color to fade or lerp to
    //-----------------------------------------------------------------------------------------------------------------------------

    void Start()
    {
        fullResistance = 0;
        renderer       = this.GetComponent <Renderer>();                                //get a reference to the renderer
        myColor        = renderer.material.GetColor("_EmissionColor");                  //grab the emission color from the renderer

        //locate and cache important object pointers
        try
        {
            overlord = GameObject.FindGameObjectWithTag("master").GetComponent <Overlord>();
            resCore  = overlord.resourceCore;
            resMgr   = resCore.resourceSlice;
            pls      = overlord.requestPlayerList();
            active   = true;
        }
        catch (System.Exception e)
        {
            //failed to find an overlord in the scene, sp we'll deactivate this tile's logic.
            //this will happen on the menu scene every time
            e.ToString();
            active = false;
        }
    }