public override void Initialize() { m_WallJumpSettings = FindObjectOfType <WallJumpSettings>(); m_Configuration = Random.Range(0, 5); m_AgentRb = GetComponent <Rigidbody>(); m_ShortBlockRb = shortBlock.GetComponent <Rigidbody>(); m_SpawnAreaBounds = spawnArea.GetComponent <Collider>().bounds; m_GroundRenderer = ground.GetComponent <Renderer>(); m_GroundMaterial = m_GroundRenderer.material; spawnArea.SetActive(false); m_ResetParams = Academy.Instance.EnvironmentParameters; // Update model references if we're overriding var modelOverrider = GetComponent <ModelOverrider>(); if (modelOverrider.HasOverrides) { noWallBrain = modelOverrider.GetModelForBehaviorName(m_NoWallBehaviorName); m_NoWallBehaviorName = ModelOverrider.GetOverrideBehaviorName(m_NoWallBehaviorName); smallWallBrain = modelOverrider.GetModelForBehaviorName(m_SmallWallBehaviorName); m_SmallWallBehaviorName = ModelOverrider.GetOverrideBehaviorName(m_SmallWallBehaviorName); bigWallBrain = modelOverrider.GetModelForBehaviorName(m_BigWallBehaviorName); m_BigWallBehaviorName = ModelOverrider.GetOverrideBehaviorName(m_BigWallBehaviorName); } }
public void Reset(float duration, Direction wallDirection, WallJumpSettings wallJumpSettings) { this._overrideEndTime = Time.time + duration; this._wallDirection = wallDirection; this._wallJumpSettings = wallJumpSettings; this._hasDetached = false; }
public void Reset(float duration, Direction wallDirection, WallJumpSettings wallJumpSettings) { this._overrideEndTime = duration < 0f ? null : (float?)(Time.time + duration); this._hasJumpedFromWall = false; this._wallJumpSettings = wallJumpSettings; this._wallJumpDirectionMultiplier = wallDirection == Direction.Right ? -1f : 1f; _axisOverride = new AxisState(-this._wallJumpDirectionMultiplier); }
public override void InitializeAgent() { m_WallJumpSettings = FindObjectOfType <WallJumpSettings>(); m_Configuration = Random.Range(0, 5); m_AgentRb = GetComponent <Rigidbody>(); m_ShortBlockRb = shortBlock.GetComponent <Rigidbody>(); m_SpawnAreaBounds = spawnArea.GetComponent <Collider>().bounds; m_GroundRenderer = ground.GetComponent <Renderer>(); m_GroundMaterial = m_GroundRenderer.material; spawnArea.SetActive(false); }