Ejemplo n.º 1
0
    void Start()
    {
        building = GetComponentInParent <Building>().buildingCount;
        firable  = GetComponent <IFirable>();

        firable.onFire += Destroy;
    }
Ejemplo n.º 2
0
    void FetchWeaponBehaviorsInternally()
    {
        var components = weapon.GetComponents <MonoBehaviour>();

        foreach (var component in components)
        {
            if (component is IFirable)
            {
                // Return back the weapon component
                weaponComponent = (IFirable)component;
                //.Log("Found component");
            }
        }

        var aimComponents = aimController.GetComponents <MonoBehaviour>();

        foreach (var component in aimComponents)
        {
            if (component is IWieldable)
            {
                IWieldable wieldableComponent = (IWieldable)component;
                wieldableComponent.SetWielder((IWielder)this);
            }
        }
    }
Ejemplo n.º 3
0
 private void Awake()
 {
     firable         = GetComponentInParent <IFirable>();
     firable.onFire += FireEffect;
     OnAwake();
 }