コード例 #1
0
ファイル: Pointer.cs プロジェクト: losersEngine/Breath
 public void OnTriggerEnter(Collider other)
 {
     if (tags.Equals(other.tag))
     {
         collidings++;
         pointing = other.gameObject.GetComponent <PodiumController> ();
     }
 }
コード例 #2
0
    private void pickup()
    {
        PodiumController pointed = pointer.getPointing();

        if (pointed != null)
        {
            carry = pointed.TakeItem();
        }
    }
コード例 #3
0
    private void drop()
    {
        PodiumController pointed = pointer.getPointing();

        if (pointed != null && pointed.isEmpty())
        {
            GameObject aux = carry;
            carry = null;
            pointed.PlaceItem(aux);
        }
    }
コード例 #4
0
ファイル: Pointer.cs プロジェクト: losersEngine/Breath
    public void OnTriggerExit(Collider other)
    {
        if (tags.Equals(other.tag))
        {
            collidings--;

            if (collidings == 0)
            {
                pointing = null;
            }
        }
    }
コード例 #5
0
 public void GeneratePodiums()
 {
     // Get all the position available for a spawning
     for (int i = 0; i < m_spawnPos.Length; i++)
     {
         // Pick a random number for the type of podium
         int index = Random.Range(0, 3);
         // Instantiate a podium at a unique position from the array
         GameObject       aPodium = Instantiate(m_podiums[index], m_spawnPos[i].position, m_spawnPos[i].rotation);
         PodiumController pc      = aPodium.GetComponent <PodiumController>();
         pc.gm      = GameObject.Find("GM");
         pc.m_items = m_items;
         pc.SelectModel();
     }
 }
コード例 #6
0
ファイル: Pointer.cs プロジェクト: losersEngine/Breath
 // Use this for initialization
 void Start()
 {
     pointing   = null;
     collidings = 0;
 }