コード例 #1
0
ファイル: Crosshair.cs プロジェクト: mcnedward/unity-project
 // Use this for initialization
 void Start()
 {
     _hands = FindObjectOfType<Elements>();
     _currentElement = 0;
     _elementList = new Elements.Element[3];
     _elementList[0] = Elements.Element.Fire;
     _elementList[1] = Elements.Element.Ice;
     _elementList[2] = Elements.Element.Bolt;
 }
コード例 #2
0
ファイル: Enchant.cs プロジェクト: mcnedward/unity-project
 /// <summary>
 /// Sets the currently selected element.
 /// </summary>
 /// <param name="element">The current element.</param>
 public void SetElement(Elements.Element element)
 {
     if (_enchant != null)
         Extensions.ToggleObject(_enchant, false);
     _element = element;
     switch (element)
     {
         case Elements.Element.Fire:
             _enchant = _fireEnchant;
             break;
         case Elements.Element.Ice:
             _enchant = _iceEnchant;
             break;
         case Elements.Element.Bolt:
             _enchant = _boltEnchant;
             break;
         default:
             _enchant = _fireEnchant;
             break;
     }
     Extensions.ToggleObject(_enchant, false);
 }