public virtual void OnStart() { gameObject.mLayerMask.AddLayer(LayerMask.Layers.LAYER_NORAYCAST); // Disable Collision trigger stuff triggerPhysics = gameObject.RequireComponent<CPhysics>(); triggerPhysics.mColliderType = 0; // static triggerPhysics.mIsTriggered = true; // Disable collision response // Disable CMeshRenderer triggerMesh = gameObject.RequireComponent<CMeshRenderer>(); triggerMesh.setEnabled(false); }
public void OnStart() { if (gameObject.transform.GetParent() != null) { gameObject.transform.SetParent(null); } speedX = 0; speedZ = 0; currSpeed = speedNormal; speedWhenJumped = 0.0f; canJump = true; // playerBox is actually my own gameObject playerBox = gameObject; // GameObject.GetGameObjectByName("PlayerBoxCollider"); playerBoxMesh = playerBox.RequireComponent<CMeshRenderer>(); playerBoxMesh.setEnabled(false); playerCamera = Common.GetStealthPlayerCamera(); playerCamScript = GetScript<FirstPersonCamera>(playerCamera); player = Common.GetStealthPlayerMesh(); anim = player.RequireComponent<CAnimationController>(); anim.mIsPlaying = true; playerPhysics = gameObject.RequireComponent<CPhysics>(); playerPhysics.mColliderType = 1; idle = new State(smc, State_Idle_Enter, State_Idle_Update, State_Idle_Exit); move = new State(smc, State_Move_Enter, State_Move_Update, State_Move_Exit); jump = new State(smc, State_Jump_Enter, State_Jump_Update, State_Jump_Exit); crouch = new State(smc, State_Crouch_Enter, State_Crouch_Update, State_Crouch_Exit); sprinting = new State(smc, State_Sprinting_Enter, State_Sprinting_Update, State_Sprinting_Exit, 0.5f); sprinting.NextState = sprinting; notsprinting = new State(smc, State_NotSprinting_Enter, State_NotSprinting_Update, State_NotSprinting_Exit); smc.SetState(idle); sprint_smc.SetState(notsprinting); footstepID = GetSoundComponent().GetUniqueEvent("P1_FOOTSTEPS.vente", 0); }
public void Reset() { mStateOfPushedIn = 0; mIsPushedIn = false; isTrapUnlocked = false; isActivated = false; Vector3 currPos = gameObject.transform.GetPosition(CTransform.TransformSpace.LOCAL); currPos.Z = mInitZ; gameObject.transform.SetPosition(currPos, CTransform.TransformSpace.LOCAL); mZMoved = 0.0f; buttonMesh = gameObject.RequireComponent<CMeshRenderer>(); buttonColor = SharpMocha.WHITE; buttonMesh.GetMaterial().SetColor(SharpMocha.BLACK); buttonMesh.mEmissiveColor = buttonColor; buttonMesh.setEnabled(false); }
public void OnStart() { mBlinkingLight = gameObject.RequireComponent<CMeshRenderer>(); mBlinkingLight.setEnabled(false); }