void Awake() { rigidbody = GetComponent<Rigidbody2D>(); spriteRenderer = GetComponent<SpriteRenderer>(); animator = GetComponent<Animator>(); groundTester = GetComponentInChildren<GroundTester>(); }
override protected void Start() { base.Start(); body = GetComponent <Rigidbody2D>(); Debug.Assert(body != null, "could not find player collider"); collider = GetComponent <Collider2D>(); Debug.Assert(collider != null, "could not find player collider"); input = GetComponent <InputRouter>(); Debug.Assert(collider != null, "could not find input router"); playerCondition = GetComponent <PlayerCondition>(); Debug.Assert(playerCondition != null, "could not find playerCondition"); animationManager = GetComponent <AnimationManager>(); Debug.Assert(animationManager != null, "could not find animationManager"); groundTester = transform.Find("GroundTester")?.GetComponent <GroundTester>(); Debug.Assert(groundTester != null, "could not find groundTester"); Debug.Log(name + " " + walkGroundSpeed); //Physics2D.gravity = Vector2.zero; Debug.Log(name + " " + playerCondition); WallDetachState = WallDetach.CONTROL; Rebase(); }
void Awake() { rigidbody = GetComponent <Rigidbody2D>(); spriteRenderer = GetComponent <SpriteRenderer>(); animator = GetComponent <Animator>(); groundTester = GetComponentInChildren <GroundTester>(); }
override protected void Start() { base.Start(); body = GetComponent <Rigidbody2D>(); Debug.Assert(body != null, "could not find player collider"); collider = GetComponent <Collider2D>(); Debug.Assert(collider != null, "could not find player collider"); input = GetComponent <InputRouter>(); Debug.Assert(collider != null, "could not find input router"); playerCondition = GetComponent <PlayerCondition>(); Debug.Assert(playerCondition != null, "could not find playerCondition"); animationManager = GetComponent <AnimationManager>(); Debug.Assert(animationManager != null, "could not find animationManager"); groundTester = transform.Find("GroundTester")?.GetComponent <GroundTester>(); Debug.Assert(groundTester != null, "could not find groundTester"); normalTester = transform.Find("NormalTester")?.GetComponent <NormalTester>(); Debug.Assert(normalTester != null, "could not find NormalTester"); crouchBlocker = transform.Find("CrouchBlocker")?.GetComponent <CrouchBlocker>(); Debug.Assert(crouchBlocker != null, "could not find CrouchBlocker"); Debug.Log(name + " " + walkGroundSpeed); //Search Particle system Transform pxBlob = transform.Find("PxBlobs"); Debug.Assert(pxBlob != null, "could not find PxBlobs"); Transform rabbits = pxBlob.transform.Find("Rabbits"); Debug.Assert(rabbits != null, "could not find Rabbits"); partSystem = rabbits.GetComponent <ParticleSystem>(); //Physics2D.gravity = Vector2.zero; Debug.Log(name + " " + playerCondition); WallDetachState = WallDetach.CONTROL; Rebase(); }