コード例 #1
0
 void Awake()
 {
     if (myDesk == null && Random.Range(1, 100) > 80)
     {
         myDesk = this;
         deskSprite.GetComponent <Renderer>().material.SetColor("_EmisColor", targetDeskColor);
     }
 }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        if (myDesk == null)
        {
            myDesk = this;
        }

        flickered = false;
        nextFlick = Time.time + Random.Range(flickeringMin, flickeringMax);
        switched  = false;
        SetDeskStatus(false);
    }