コード例 #1
0
ファイル: KeyController.cs プロジェクト: TonyPwny/CS428P1
 public void KeyDropped(KeyController key, Vector3 position)
 {
     keyDropped = true;
     key.GetComponentInParent <Transform>().position = position;
     key.transform.localPosition += new Vector3(0f, 1.5f, 0f);
     key.gameObject.SetActive(true);
     key.GetComponent <Rigidbody>().isKinematic = false;
     key.GetComponent <Rigidbody>().AddForce(new Vector3(0f, 400f, 0f));
     spotLight.gameObject.SetActive(true);
     GamePlusController.instance.MakeAnnouncement("The key has been knocked off of you!", 5);
 }