Exemple #1
0
    public void SetWeapon(ScriptableObjectReference weaponReference)
    {
        Weapon weapon = (Weapon)weaponReference.value; //take the value from the input field

        this.Weapon = EntityWeapon.FromWeapon(weapon); //turn it into the EntityWeapon
        Debug.Log($"weapon: {Weapon.Weapon.WeaponName}");
    }
Exemple #2
0
    public void SetWeapon(string weaponID)
    {
        Weapon weapon = WeaponDatabase.Instance.FindWeaponByID(weaponID);

        if (weapon != null)
        {
            EntityWeapon EW = new EntityWeapon(weapon);
            Weapon = EW;
        }
    }
Exemple #3
0
    protected void Awake()
    {
        entity   = GetComponent <Entity>();
        ES       = GetComponent <EntitySight>();
        CM       = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <TaskManager>();
        mManager = CM.GetComponent <MapManager>();
        EM       = CM.GetComponent <EntityManager>();


        move           = GetComponent <EntityMove>();
        EW             = GetComponent <EntityWeapon>();
        entity.OnInit += () => EntityClock = CM.Clock;
        entity.OnInit += () => Act();
    }
Exemple #4
0
 private void Awake()
 {
     IC  = FindObjectOfType <ItemCollection>();
     ICU = GetComponent <ItemCollectionUI>();
     ICU.OnItemUIClick += (x) => OnItemSelect(x);
     PW              = FindObjectOfType <EntityManager>().Player.GetComponent <EntityWeapon>();
     OnItemSelected += RefreshSelectionMarker;
     FindObjectOfType <PlayerInputBroadcaster>().Subscribe(gameObject);
     ItemUIs = new List <SelectableItemUI>(GetComponentsInChildren <SelectableItemUI>());
     GetComponentInParent <PanelUI>().OnVisibilityChange += (b) => { if (!b)
                                                                     {
                                                                         StopSwap();
                                                                     }
     };
 }
 private void Update()
 {
     if (Input.GetButtonDown(BasicAttackButton))
     {//Run normal weapon attack
         EntityWeapon entityWeapon = EntitySystem.Instance.MainPlayer.Weapon;
         if (entityWeapon != null)
         {
             entityWeapon.Run(EntitySystem.Instance.MainPlayer);
         }
     }
     if (Input.GetButtonDown(SkillButton))
     {//Run normal skill
         EntitySystem.Instance.MainPlayer.RunSkill();
     }
     if (Input.GetButtonDown(UltimateSkillButton))
     {//Run normal skill
         EntitySystem.Instance.MainPlayer.RunUltimateSkill();
     }
 }
Exemple #6
0
 protected override void Awake()
 {
     base.Awake();
     PW = FindObjectOfType <EntityManager>().Player.GetComponent <EntityWeapon>();
     PW.OnRefreshWeapon += PW_OnRefreshWeapon;
 }
Exemple #7
0
 public void SetWeapon(Weapon weapon)
 {
     Weapon = EntityWeapon.FromWeapon(weapon);
 }
Exemple #8
0
 public void SetWeapon(EntityWeapon weapon)
 {
     Weapon = weapon;
 }