Esempio n. 1
0
 // Use this for initialization
 void Awake()
 {
     walk         = GetComponent <WalkAbs>();
     patrol       = GetComponent <Patrol>();
     idle         = GetComponent <Idle>();
     operable     = true;
     this.enabled = false;
 }
Esempio n. 2
0
 // Use this for initialization
 void Awake()
 {
     walk     = GetComponent <WalkAbs>();
     patrol   = GetComponent <Patrol>();
     idle     = GetComponent <Idle>();
     body     = GetComponent <ChipmunkBody>();
     stop     = true;
     operable = true;
 }
Esempio n. 3
0
    public bool isTargetFacingMe()
    {
        // if player is facing to the ghost then Dot product will be < 0. Only considers X coordinate
        Vector2 towardTarget = chase.getTarget().position - transform.position;

        if (targetWalkComp == null)
        {
            targetWalkComp = chase.getTarget().GetComponent <WalkAbs>();
        }
        return((targetWalkComp.getLookingDir().x *towardTarget.x) <= 0f);
    }
Esempio n. 4
0
    void Awake()
    {
        crouching = false;

        // take the collider and some useful values
        box             = GetComponent <ChipmunkBoxShape>();
        colliderCenterY = box.center.y;
        centerOffsetY   = ((1f - crouchColliderProportion) * 0.5f) * box.size.y;

        jump     = GetComponent <Jump>();
        sneak    = GetComponent <Sneak>();
        move     = GetComponent <WalkAbs>();
        crouchAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Crouch, true);
    }
Esempio n. 5
0
 private void stop()
 {
     targetWalkComp = null;
     chase.stopChasing();
     fly.stopFlying();
 }
Esempio n. 6
0
    private float dir = 1f;     // default value

    // Use this for initialization
    void Awake()
    {
        walk = GetComponent <WalkAbs>();
    }
Esempio n. 7
0
 // Use this for initialization
 void Awake()
 {
     dir  = 1f;        // initial normalized direction
     walk = GetComponent <WalkAbs>();
     stop = false;     // patrolling is enabled
 }
Esempio n. 8
0
 void Awake()
 {
     move   = GetComponent <WalkAbs>();
     jump   = GetComponent <Jump>();
     crouch = GetComponent <Crouch>();
 }