コード例 #1
0
    void Update()
    {
        if (active)
        {
            if (!hasOpened)
            {
                ChestOpen.SetActive(true);
                ChestClosed.SetActive(false);

                GameObject k = Instantiate(Key);
                k.transform.position = transform.position + new Vector3(0, 1, 0);
                k.transform.rotation = Quaternion.Euler(new Vector3(0, 90, 0));

                Keyhole.correctKey             = k;
                k.GetComponent <Key>().keyword = Keyhole.keyword;

                foreach (ButtonCompination BC in ToActivate)
                {
                    BC.gameObject.SetActive(false);
                }

                hasOpened = true;
            }
        }
        else
        {
            CheckActives();
        }
    }
コード例 #2
0
 void Start()
 {
     ChestClosed.SetActive(true);
     ChestOpen.SetActive(false);
 }