Esempio n. 1
0
 void Start()
 {
     CreatePhase(startPhase);
     grounder     = GetComponent <Grounder>();
     viableAction = new List <ObjectAction>();
     viableHangs  = new List <HangObject>();
 }
 // Use this for initialization
 void Awake()
 {
     if (grounder == null)
     {
         grounder = transform.parent.GetComponent <Grounder>();
     }
     parentLastPos = transform.parent.transform.position;
 }
 // Use this for initialization
 void Start()
 {
     if (grounder == null)
     {
         grounder = GetComponent <Grounder>();
     }
     rbody = GetComponent <Rigidbody>();
     rbody.freezeRotation = true;
     rbody.useGravity     = false;
 }
Esempio n. 4
0
 void Start()
 {
     phaseQue = new Queue <Phases>();
     CreatePhase(startPhase);
     grounder        = GetComponent <Grounder>();
     viableAction    = new List <ObjectAction>();
     viableHangs     = new List <HangObject>();
     joints          = new List <Joint2D>();
     activeAbilities = new List <SuperAbility>();
 }
Esempio n. 5
0
 private void OnTriggerStay(Collider other)
 {
     if (Target == null)
     {
         var enemy = other.GetComponent <Grounder>();
         if (enemy != null)
         {
             Target = enemy;
         }
     }
 }
Esempio n. 6
0
    private void OnTriggerExit(Collider other)
    {
        var enemy = other.GetComponent <Grounder>();

        if (enemy != null)
        {
            enemiesWithinRange--;
            if (Target == enemy)
            {
                Target = null;
            }
        }
    }
Esempio n. 7
0
    private void OnTriggerEnter(Collider other)
    {
        var enemy = other.GetComponent <Grounder>();

        if (enemy != null)
        {
            enemiesWithinRange++;
            if (Target == null)
            {
                Target = enemy;
            }
        }
    }
Esempio n. 8
0
    public override bool Enter()
    {
        firstLoopWait = true;
        bigBox        = actionObject.transform.parent.gameObject;
        iks           = player.GetComponent <IKController>();
        handArea      = actionObject.GetComponent <SpriteRenderer>();
        PhaseController pc = player.GetComponent <PhaseController>();

        joystick                  = pc.joystick;
        attrs                     = pc.attributes;
        grounder                  = pc.grounder;
        rb                        = player.GetComponent <Rigidbody2D>();
        bigBoxRb                  = bigBox.GetComponent <Rigidbody2D>();
        anim                      = player.GetComponent <Animator>();
        distanceFromBox           = (player.transform.localScale.x > 0) ? -distanceFromBox : distanceFromBox;
        player.transform.position = new Vector3(actionObject.transform.position.x + distanceFromBox, player.transform.position.y, 0);
        iks.leftArm.ik.transform.gameObject.SetActive(true);
        iks.rightArm.ik.transform.gameObject.SetActive(true);
        anim.SetBool("pulling", true);
        CreateJoint();
        return(true);
    }
Esempio n. 9
0
 private void DrawFinalIKInspector(Grounder finalIK)
 {
     DrawInspector(finalIK);
 }