EgonMilanVotrubec

TestScript

Mar 27th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using JeffreyStephens;
  2. using JeffreyStephens.Game;
  3. using JeffreyStephens.Weapons;
  4. using UnityEngine;
  5.  
  6.  
  7. /// <summary>
  8. /// Create a blank GameObject in the scene and attach this script by dragging it onto the gameobject in the hierarchy.
  9. /// </summary>
  10. public class TestScript : MonoBehaviour
  11. {
  12.     public WeaponManager WeaponManager;
  13.  
  14.     void Start ( )
  15.     {
  16.         WeaponManager = new WeaponManager ( );
  17.  
  18.         WeaponManager.AddWeapon ( "FireBlade", new Weapon ( )
  19.         {
  20.             Accuracy = 10,
  21.             Damage = 5,
  22.             Element = ElementType.Fire,
  23.             WeaponModel = null
  24.         } );
  25.  
  26.         WeaponManager.AddWeapon ( "IceBlade", new Weapon ( )
  27.         {
  28.             Accuracy = 10,
  29.             Damage = 5,
  30.             Element = ElementType.Water,
  31.             WeaponModel = null
  32.         } );
  33.  
  34.  
  35.         var fireblade = WeaponManager.GetWeapon ( "FireBlade" );
  36.         Debug.Log ( $"fireblade.Accuracy = {fireblade.Accuracy}" );
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment