Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     this.player = PlayerController.instance;
     this.rb2d = this.GetComponent<Rigidbody2D> ();
     this.melee = this.GetComponent<MeleeAttacker> ();
     this.animator = this.GetComponent<Animator> ();
 }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     this.player   = PlayerController.instance;
     this.rb2d     = this.GetComponent <Rigidbody2D> ();
     this.melee    = this.GetComponent <MeleeAttacker> ();
     this.animator = this.GetComponent <Animator> ();
 }
Exemplo n.º 3
0
    void DoOwie(Collider2D collider)
    {
        MeleeAttacker meleeAttacker = this.gameObject.GetComponent <MeleeAttacker> ();

        if (collider.tag != this.tag)
        {
            if (collider.tag == "Player" || collider.tag == "Enemy" || collider.tag == "Animal")
            {
                if (collider.tag == "Enemy")
                {
                    collider.gameObject.GetComponent <EnemyFullAI>().toggleAggro(true);
                }
                if (meleeAttacker != null)
                {
                    if (meleeAttacker.Locked == false)
                    {
                        OnOwie(collider);
                        meleeAttacker.LockAttacker();
                    }
                }
                else
                {
                    OnOwie(collider);
                }
            }
        }
    }
Exemplo n.º 4
0
    protected void Awake()
    {
        _mover = gameObject.GetComponent<RigidBodyMover>();
        _meleeAttacker = gameObject.GetComponent<MeleeAttacker>();

        Enable();
    }
Exemplo n.º 5
0
    protected void Awake()
    {
        _mover         = gameObject.GetComponent <RigidBodyMover>();
        _meleeAttacker = gameObject.GetComponent <MeleeAttacker>();

        Enable();
    }
Exemplo n.º 6
0
    private void Start()
    {
        walker         = gameObject.GetComponent <Walker>();
        melee          = gameObject.GetComponent <MeleeAttacker>();
        mageProjectile = gameObject.GetComponent <Shooter>().projectile;

        initialVel      = walker.velocity;
        initialDmgMelee = melee.damage;
        initialDmgMage  = mageProjectile.damage;

        rageState = State.NORMAL;
    }
Exemplo n.º 7
0
    // Use this for initialization
    void Start()
    {
        this.rb2d           = this.GetComponent <Rigidbody2D> ();
        this.animator       = this.GetComponent <Animator> ();
        this.meleeAttacker  = this.GetComponent <MeleeAttacker> ();
        this.rangedAttacker = this.GetComponent <RangedAttacker> ();
        this.toolUser       = this.GetComponent <ToolUser> ();

        StartCoroutine(StartAnimations());
        // Give player starting items
        // this.inventory.Add("sword");
    }
Exemplo n.º 8
0
    // Use this for initialization
    void Start()
    {
        this.rb2d           = this.GetComponent <Rigidbody2D> ();
        this.animator       = this.GetComponent <Animator> ();
        this.meleeAttacker  = this.GetComponent <MeleeAttacker> ();
        this.rangedAttacker = this.GetComponent <RangedAttacker> ();
        this.toolUser       = this.GetComponent <ToolUser> ();


        this.sword      = gameObject.AddComponent <AudioSource> ();
        this.sword.clip = Resources.Load("Sounds/SwordSwing1") as AudioClip;
        print(this.sword);

        // Give player starting items
        //this.inventory.Add("sword");
    }
Exemplo n.º 9
0
    //private Animator animator;

    // Use this for initialization
    private void Start()
    {
        cursor  = GetComponent <MouseCursor>();
        shooter = GetComponent <Shooter>();
        if (!shooter)
        {
            Debug.Log("Dependence not found: shooter");
        }
        if (!(meleeAttacker = GetComponent <MeleeAttacker>()))
        {
            Debug.Log("Dependence not found: meleeAttacker");
        }

        if (!(shield = GetComponent <Shield>()))
        {
            Debug.Log("Dependence not found: shield");
        }

        skillHealing = GetComponent <SkillHealing>();
        jumper       = GetComponent <SkillJumper>();
        sounds       = GetComponentInChildren <AttackSounds>();
        //animator = transform.GetChild(1).GetComponent<Animator>();
        cursor.ChangueCursor((int)CurrentMode);
    }
Exemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        this.rb2d = this.GetComponent<Rigidbody2D> ();
        this.animator = this.GetComponent<Animator> ();
        this.meleeAttacker = this.GetComponent<MeleeAttacker> ();
        this.rangedAttacker = this.GetComponent<RangedAttacker> ();
        this.toolUser = this.GetComponent<ToolUser> ();

        StartCoroutine (StartAnimations());
        // Give player starting items
        // this.inventory.Add("sword");
    }
Exemplo n.º 11
0
 public void setWeapon(MeleeAttacker meleeWep)
 {
     this.meleeWeapon = meleeWep;
 }
Exemplo n.º 12
0
 public void setWeapon(MeleeAttacker meleeWep)
 {
     this.meleeWeapon = meleeWep;
 }
Exemplo n.º 13
0
    // Use this for initialization
    void Start()
    {
        this.rb2d = this.GetComponent<Rigidbody2D> ();
        this.animator = this.GetComponent<Animator> ();
        this.meleeAttacker = this.GetComponent<MeleeAttacker> ();
        this.rangedAttacker = this.GetComponent<RangedAttacker> ();
        this.toolUser = this.GetComponent<ToolUser> ();

        this.sword = gameObject.AddComponent<AudioSource> ();
        this.sword.clip = Resources.Load ("Sounds/SwordSwing1") as AudioClip;
        print (this.sword);

        // Give player starting items
        //this.inventory.Add("sword");
    }
Exemplo n.º 14
0
 private void Start()
 {
     attacker = GetComponent <MeleeAttacker>();
 }