public bool SetUse(WildFrog _frog) { if (Object.op_Equality((Object)_frog, (Object)null) || Object.op_Inequality((Object)this._user, (Object)null) && Object.op_Inequality((Object)this._user, (Object)_frog)) { return(false); } this._user = _frog; return(true); }
public bool StopUse(WildFrog _frog) { if (Object.op_Equality((Object)_frog, (Object)null) || Object.op_Equality((Object)this._user, (Object)null) || Object.op_Inequality((Object)this._user, (Object)_frog)) { return(false); } this._user = (WildFrog)null; this.SetCoolTime(); return(true); }
public void Initialize(FrogHabitatPoint _habitatPoint) { this.Clear(); if (Object.op_Equality((Object)(this.habitatPoint = _habitatPoint), (Object)null)) { this.SetState(AnimalState.Destroyed, (System.Action)null); } else if (!this.habitatPoint.SetUse(this)) { this.SetState(AnimalState.Destroyed, (System.Action)null); } else { MapArea ownerArea = this.habitatPoint.OwnerArea; this.ChunkID = !Object.op_Inequality((Object)ownerArea, (Object)null) ? 0 : ownerArea.ChunkID; this.LoadBody(); this.SetStateData(); this.NavMeshCon.Animator = this.animator; if (Object.op_Inequality((Object)this.animator, (Object)null)) { this.rootMotion = ((Component)this.animator).GetOrAddComponent <AnimalRootMotion>(); } SkinnedMeshRenderer componentInChildren = (SkinnedMeshRenderer)((Component)this).GetComponentInChildren <SkinnedMeshRenderer>(true); this.material = !Object.op_Inequality((Object)componentInChildren, (Object)null) ? (Material)null : ((Renderer)componentInChildren).get_material(); this.rootMotion.OnMove = (System.Action <Vector3, Quaternion>)((p, q) => { this.NavMeshCon.Move(Vector3.op_Subtraction(p, this.Position)); Quaternion quaternion = Quaternion.op_Multiply(q, Quaternion.Inverse(this.Rotation)); Vector3 eulerAngles = ((Quaternion) ref quaternion).get_eulerAngles(); eulerAngles.x = (__Null)(double)(eulerAngles.z = (__Null)0.0f); WildFrog wildFrog = this; // ISSUE: explicit non-virtual call // ISSUE: explicit non-virtual call __nonvirtual(wildFrog.Rotation) = Quaternion.op_Multiply(__nonvirtual(wildFrog.Rotation), Quaternion.Euler(eulerAngles)); }); bool flag = false; this.BodyEnabled = flag; this.MarkerEnabled = flag; this.NavMeshCon.SetEnabled(false); this.TargetMapArea = this.habitatPoint.OwnerArea; this.IsNearPlayer = false; this.SetState(AnimalState.Start, (System.Action)null); } }
private void UpdateCoolTime() { if (this.IsCountStop || Object.op_Inequality((Object)this._user, (Object)null) || (!this.IsActive || !this.IsCountCoolTime) || Mathf.Approximately(0.0f, Time.get_timeScale())) { return; } this.CoolTimeCounter -= Time.get_unscaledDeltaTime(); if ((double)this.CoolTimeCounter > 0.0) { return; } this.CoolTimeCounter = 0.0f; if (this.AddCheck == null || this.AddAnimalAction == null || !this.AddCheck(this)) { return; } this._user = this.AddAnimalAction(this); this.IsCountCoolTime = Object.op_Equality((Object)this._user, (Object)null); }