// Use this for initialization void Awake() { crouch = GetComponent <Crouch>(); jumpAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Jump, true); body = GetComponent <ChipmunkBody>(); resetStatus(); }
public void setIdle(bool force) { // not idle if jumping and force = false if (!force && jump != null && jump.IsJumping()) { return; } if (move != null) { move.stopWalking(); } if (crouch != null) { crouch.noCrouch(); } // due to problems on Unity's initialization order there is a use case where the object isn't instantiated if (idleAC == null) { idleAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Idle, true); } if (idleAC != null) { idleAC.setupAndPlay(); } }
// Use this for initialization void Awake() { lookUpAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.LookUpwards, true); dirSign = 0f; walk = GetComponent <PlayerWalk>(); // since we cannot create an instance from a MonoBehaviour then do next tempConfig = gameObject.AddComponent <PlayerFollowerXYConfig>(); // disable the dummy component from being updated by Unity3D game loop tempConfig.enabled = false; }
void Awake() { jump = GetComponent <Jump>(); idle = GetComponent <Idle>(); crouch = GetComponent <Crouch>(); shape = GetComponent <ChipmunkShape>(); walkAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Walk, true); lookingRight = true; reset(); }
void Awake() { jump = GetComponent <Jump>(); idle = GetComponent <Idle>(); crouch = GetComponent <Crouch>(); body = GetComponent <ChipmunkBody>(); walkAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Walk, true); agUpdater = GetComponent <AirGroundControlUpdater>(); lookingRight = true; }
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); }
// Use this for initialization void Awake() { hideAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Hide, true); hidden = false; // take the collider and some useful values ChipmunkBoxShape[] boxes = GetComponents <ChipmunkBoxShape>(); for (int i = 0, c = boxes.Length; i < c; ++i) { box = boxes[i]; // the koopa has two chipmunk boxes, take the correct one if ("KoopaTroopa".Equals(box.collisionType)) { break; } } colliderCenterY = box.center.y; centerOffsetY = ((1f - hideColliderProportion) * 0.5f) * box.size.y; }
void Start() { lookUpwards = GetComponent <LookUpwards>(); walkAC_orig = walkAC; walkLookingUpAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.WalkLookUpwards, true); }
void Start() { // NOTE: children's Awake() doesn't exist on parent's Awake(), so you must get children components on Start() idleAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Idle, true); }
void Start() { // NOTE: it seems that Awake() from children are executed after parent's Awake() idleAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Idle, true); }
void Awake() { sneakAC = AnimateTiledConfig.getByName(gameObject, EnumAnimateTiledName.Sneak, true); }