示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        allChildren  = GetComponentsInChildren <Transform>();
        childObjects = new List <GameObject>();
        foreach (Transform child in allChildren)
        {
            childObjects.Add(child.gameObject);
        }

        meshRenderer = GetComponent <MeshRenderer>();
        foreach (GameObject child in childObjects)
        {
            if (child.CompareTag("ActivatableWire"))
            {
                meshRenderer = child.GetComponent <MeshRenderer>();
                if (pedestal.GetCurrLevel() > 0)
                {
                    meshRenderer.material.color = activatedColor;
                    currentColor = activatedColor;
                }
                else
                {
                    meshRenderer.material.color = deactivatedColor;
                    currentColor = deactivatedColor;
                }
            }
        }
    }
 bool IsLevelFinal(Pedestal pedestal, int finalLevel)
 {
     if (pedestal == null)
     {
         return(false);
     }
     if (pedestal.GetCurrLevel() == finalLevel)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
    public void OnPedestalDeactivate(Pedestal source)
    {
        if (source.GetCurrLevel() <= 0 && activeSources.Contains(source))
        {
            activeSources.Remove(source);
        }
        else
        {
            Debug.LogError("Activatable Object did not reference active pedestal! " + this);
        }

        int level = GetLevel();

        if (this.enabled)
        {
            OnDepowered(source, GetLevel());
        }
    }
示例#4
0
 // Start is called before the first frame update
 void Start()
 {
     pastPedestalLevel = pedestal.GetCurrLevel();
 }