Exemplo n.º 1
0
 private void Awake()
 {
     CommonAccessibles.stateChangeHandler += CreateChildren;
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
         return;
     }
     Destroy(this.gameObject);
 }
Exemplo n.º 2
0
    // Use this for initialization
    void Awake()
    {
        //var color = gameObject.GetComponent<Renderer>().material.color;
        //var newColor = new Color(color.r, color.g, color.b, 0.5f);
        //gameObject.GetComponent<Renderer>().material.color = newColor;

        if (grid == null)
        {
            grid = FindObjectOfType <GridSys>();
        }
        if (playerShip == null)
        {
            playerShip = FindObjectOfType <ShipBlockList>();
        }

        myMesh = gameObject.GetComponent <MeshRenderer>();
        //myMesh.enabled = false;
        myMesh.material.color = new Color(myMesh.material.color.r, myMesh.material.color.g, myMesh.material.color.b, defaultOpacity);
        //isPartOfShip = false;
        hashCode = GetHashCode();
    }