Exemplo n.º 1
0
    // Private Properties //
    #endregion

    #region Unity Methods
    void Awake()
    {
        player          = GameObject.FindGameObjectWithTag("Player");
        hpModule        = gameObject.GetComponent <HPModule>();
        attackingModule = gameObject.GetComponent <AttackingModule>();
        awarnessModule  = gameObject.GetComponent <AwarnessModule>();
    }
Exemplo n.º 2
0
    public void ApplyEffect(HPModule target)
    {
        DamageOverTime myDamage = target.gameObject.AddComponent <DamageOverTime>();

        myDamage.DamageSource   = damageSource;
        myDamage.Damage         = Damage;
        myDamage.Duration       = Duration;
        myDamage.DamageInterval = DamageInterval;
    }
Exemplo n.º 3
0
    // Public Properties //

    // Private Properties //
    #endregion

    #region Unity Methods
    public void Start()
    {
        mainModule  = gameObject.GetComponent <Enemy>();
        Player      = mainModule.Player.GetComponent <HPModule>();
        playerLayer = LayerMask.GetMask("Player");
        groundLayer = LayerMask.GetMask("Ground");

        InvokeRepeating("AttackPlayer", 0, 1f);
    }
Exemplo n.º 4
0
    // Public Properties //

    // Private Properties //
    #endregion

    #region Unity Methods
    void Start()
    {
        //MAKING SURE THAT TARGET IS ONLY "ON ONE FIRE" - NO STACKING ALLOWED
        DamageOverTime other;

        if ((other = gameObject.GetComponent <DamageOverTime>()) && other != this)
        {
            Destroy(other);
        }

        target = gameObject.GetComponent <HPModule>();
        Destroy(this, Duration);
        InvokeRepeating("DamageTarget", 0f, DamageInterval);
    }
Exemplo n.º 5
0
    void Start()
    {
        if (GetComponent <HPModule>())
        {
            HPModule TEMP = GetComponent <HPModule>();
            TEMP.On_HPModule_Death += MonsterDeath;
        }

        EventManager.resetObjects += Reset;
        startingPosition           = gameObject.transform.position;

        if (JumpPower == 0)
        {
            JumpSpeed = 0;
        }

        anim = GetComponent <Animator>();
        if (DefaultFacingRight)
        {
            Vector3 theScale = transform.localScale;
            theScale.x          *= -1;
            transform.localScale = theScale;
//			BackupScale = theScale;

            Canvas[] childCanvases = GetComponentsInChildren <Canvas> ();
            foreach (Canvas child in childCanvases)
            {
                theScale    = child.transform.localScale;
                theScale.x *= -1;
                child.transform.localScale = theScale;
            }
        }

        MonsterManipulation = gameObject.AddComponent <NewObjectSpawner> ();
        MonsterManipulation.SetProjectile(0, MonsterProjectile);
        MonsterManipulation.SetToEnablePooling(0, false);

        if (GetComponent <CalculateChecks> ())
        {
            calculateChecks = GetComponent <CalculateChecks> ();
        }
        else
        {
            calculateChecks = gameObject.AddComponent <CalculateChecks> ();
        }
        calculateChecks.ChangeLayerMask(whatIsGround);
        calculateChecks.Set_ColliderIndent(ColliderIndent);

        StartCoroutine(C_StartAI());
    }
Exemplo n.º 6
0
    public virtual void Start()
    {
        EventManager.resetObjects += Reset;
        HPModuleScript             = GetComponent <HPModule> ();
        if (HPModuleScript != null)
        {
            HPModuleScript.On_HPModule_Death += OnMonsterDeath;
        }

        if (GetComponent <CalculateChecks> ())
        {
            calculateChecks = GetComponent <CalculateChecks> ();
        }
        else
        {
            calculateChecks = gameObject.AddComponent <CalculateChecks> ();
        }
        calculateChecks.ChangeLayerMask(whatIsSolid);
        calculateChecks.Set_ColliderIndent(ColliderIndent);
        calculateChecks.Set_BackwardsSprite_X(DefaultFacingLeft);

        anim             = GetComponent <Animator>();
        startingPosition = gameObject.transform.position;

        if (DefaultFacingLeft)
        {
            facingRight = false;
        }
        else
        {
            facingRight = true;
        }

        List <MethodInfo> allTheFunctions = GetFunctionList();

        PassiveAIAction    = (CustomAIAction)Delegate.CreateDelegate(typeof(CustomAIAction), this, allTheFunctions[PassiveAINumber]);
        AlertAIAction      = (CustomAIAction)Delegate.CreateDelegate(typeof(CustomAIAction), this, allTheFunctions[AlertAINumber]);
        AggressiveAIAction = (CustomAIAction)Delegate.CreateDelegate(typeof(CustomAIAction), this, allTheFunctions[AggressiveAINumber]);

        StartCoroutine(C_StartAI());
        StartCoroutine(C_CalculateSurroundings());
    }
Exemplo n.º 7
0
    // Public Properties //

    // Private Properties //
    #endregion

    #region Unity Methods
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player").GetComponent <HPModule>();
        Destroy(gameObject, 3f);
    }