示例#1
0
    public override void endFire()
    {
        this.fireStarted = false;
        if (this.burnP.GetComponent <ParticleEmitter>())
        {
            this.burnP.GetComponent <ParticleEmitter>().emit = false;
        }
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.burnP);

        while (enumerator.MoveNext())
        {
            object arg_5E_0;
            object expr_44 = arg_5E_0 = enumerator.Current;
            if (!(expr_44 is Transform))
            {
                arg_5E_0 = RuntimeServices.Coerce(expr_44, typeof(Transform));
            }
            Transform transform = (Transform)arg_5E_0;
            if (transform.GetComponent <ParticleEmitter>())
            {
                transform.GetComponent <ParticleEmitter>().emit = false;
                UnityRuntimeServices.Update(enumerator, transform);
            }
        }
        UnityEngine.Object.Destroy(this);
    }
示例#2
0
    public void OnDrawGizmosSelected()
    {
        if (AutoWayPoint.waypoints.get_length() == 0)
        {
            this.RebuildWaypointList();
        }
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.connected);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            if (Physics.Linecast(this.get_transform().get_position(), autoWayPoint.get_transform().get_position()))
            {
                Gizmos.set_color(Color.get_red());
                Gizmos.DrawLine(this.get_transform().get_position(), autoWayPoint.get_transform().get_position());
                UnityRuntimeServices.Update(enumerator, autoWayPoint);
            }
            else
            {
                Gizmos.set_color(Color.get_green());
                Gizmos.DrawLine(this.get_transform().get_position(), autoWayPoint.get_transform().get_position());
                UnityRuntimeServices.Update(enumerator, autoWayPoint);
            }
        }
    }
示例#3
0
 public override void Update()
 {
     if (Input.GetKeyDown(KeyCode.UpArrow))
     {
         IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.GetComponent <Animation>());
         while (enumerator.MoveNext())
         {
             object arg_40_0;
             object expr_26 = arg_40_0 = enumerator.Current;
             if (!(expr_26 is AnimationState))
             {
                 arg_40_0 = RuntimeServices.Coerce(expr_26, typeof(AnimationState));
             }
             AnimationState animationState = (AnimationState)arg_40_0;
             animationState.speed += 0.2f;
             UnityRuntimeServices.Update(enumerator, animationState);
         }
     }
     else if (Input.GetKeyDown(KeyCode.DownArrow))
     {
         IEnumerator enumerator2 = UnityRuntimeServices.GetEnumerator(this.GetComponent <Animation>());
         while (enumerator2.MoveNext())
         {
             object arg_AF_0;
             object expr_95 = arg_AF_0 = enumerator2.Current;
             if (!(expr_95 is AnimationState))
             {
                 arg_AF_0 = RuntimeServices.Coerce(expr_95, typeof(AnimationState));
             }
             AnimationState animationState2 = (AnimationState)arg_AF_0;
             animationState2.speed -= 0.2f;
             UnityRuntimeServices.Update(enumerator2, animationState2);
         }
     }
     if (this.currentClip == 0)
     {
         this.GetComponent <Animation>().CrossFade("walk", 0.2f);
     }
     else if (this.currentClip == 1)
     {
         this.GetComponent <Animation>().CrossFade("run", 0.2f);
     }
     else if (this.currentClip == 2)
     {
         this.GetComponent <Animation>().CrossFade("lookOut", 0.2f);
     }
     if (!this.GetComponent <Animation>().isPlaying)
     {
         this.currentClip++;
         if (this.currentClip == 3)
         {
             this.currentClip = 0;
         }
     }
 }
示例#4
0
    public override void ToggleVisibility()
    {
        object      componentsInChildren = this.get_gameObject().GetComponentsInChildren(typeof(Renderer));
        IEnumerator enumerator           = UnityRuntimeServices.GetEnumerator(componentsInChildren);

        while (enumerator.MoveNext())
        {
            Renderer renderer = (Renderer)RuntimeServices.Coerce(enumerator.get_Current(), typeof(Renderer));
            renderer.set_enabled(!renderer.get_enabled());
            UnityRuntimeServices.Update(enumerator, renderer);
        }
    }
示例#5
0
    public void RebuildWaypointList()
    {
        object[] array = Object.FindObjectsOfType(typeof(AutoWayPoint));
        AutoWayPoint.waypoints = new Array(array);
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(AutoWayPoint.waypoints);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            autoWayPoint.RecalculateConnectedWaypoints();
            UnityRuntimeServices.Update(enumerator, autoWayPoint);
        }
    }
 // Token: 0x06000016 RID: 22 RVA: 0x00003A60 File Offset: 0x00001C60
 public virtual void ModelChange(string _name)
 {
     if (!string.IsNullOrEmpty(_name))
     {
         MonoBehaviour.print("ModelChange : " + _name);
         this.curModelName = Path.GetFileNameWithoutExtension(_name);
         GameObject original = (GameObject)Resources.Load(_name, typeof(GameObject));
         UnityEngine.Object.Destroy(this.obj);
         Debug.Log(_name);
         this.obj                    = (((GameObject)UnityEngine.Object.Instantiate(original)) as GameObject);
         this.SM                     = (((SkinnedMeshRenderer)this.obj.GetComponentInChildren(typeof(SkinnedMeshRenderer))) as SkinnedMeshRenderer);
         this.SM.quality             = SkinQuality.Bone4;
         this.SM.updateWhenOffscreen = true;
         int        num             = 0;
         int        i               = 0;
         Material[] sharedMaterials = this.SM.renderer.sharedMaterials;
         int        length          = sharedMaterials.Length;
         while (i < length)
         {
             if (sharedMaterials[i].name == "face02_M")
             {
                 this.SM.renderer.materials[num] = this.faceMat_M;
             }
             else if (sharedMaterials[i].name == "face02_L")
             {
                 this.SM.renderer.materials[num] = this.faceMat_L;
             }
             num++;
             i++;
         }
         IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.animTest.animation);
         while (enumerator.MoveNext())
         {
             object obj = enumerator.Current;
             object obj3;
             object obj2 = obj3 = obj;
             if (!(obj2 is AnimationState))
             {
                 obj3 = RuntimeServices.Coerce(obj2, typeof(AnimationState));
             }
             AnimationState animationState = (AnimationState)obj3;
             this.obj.animation.AddClip(animationState.clip, animationState.name);
             UnityRuntimeServices.Update(enumerator, animationState);
         }
         this.viewCam.ModelTarget(this.GetBone(this.obj, this.boneName));
         this.SetAnimation(string.Empty + this.animationList[this.curAnim]);
         this.SetAnimationSpeed(this.animSpeed);
     }
 }
    // Token: 0x06000017 RID: 23 RVA: 0x00003C64 File Offset: 0x00001E64
    public virtual void SetAnimationSpeed(float _speed)
    {
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(this.obj.animation);

        while (enumerator.MoveNext())
        {
            object obj = enumerator.Current;
            object obj3;
            object obj2 = obj3 = obj;
            if (!(obj2 is AnimationState))
            {
                obj3 = RuntimeServices.Coerce(obj2, typeof(AnimationState));
            }
            AnimationState animationState = (AnimationState)obj3;
            animationState.speed = _speed;
            UnityRuntimeServices.Update(enumerator, animationState);
        }
    }
示例#8
0
    public void RecalculateConnectedWaypoints()
    {
        this.connected = new Array();
        IEnumerator enumerator = UnityRuntimeServices.GetEnumerator(AutoWayPoint.waypoints);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            if (!(autoWayPoint == this))
            {
                if (!Physics.CheckCapsule(this.get_transform().get_position(), autoWayPoint.get_transform().get_position(), AutoWayPoint.kLineOfSightCapsuleRadius))
                {
                    this.connected.Add(autoWayPoint);
                    UnityRuntimeServices.Update(enumerator, autoWayPoint);
                }
            }
        }
    }
示例#9
0
    public static AutoWayPoint FindClosest(Vector3 pos)
    {
        AutoWayPoint result     = null;
        float        num        = 100000f;
        IEnumerator  enumerator = UnityRuntimeServices.GetEnumerator(AutoWayPoint.waypoints);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            float        num2         = Vector3.Distance(autoWayPoint.get_transform().get_position(), pos);
            UnityRuntimeServices.Update(enumerator, autoWayPoint);
            if (num2 < num)
            {
                num    = num2;
                result = autoWayPoint;
                UnityRuntimeServices.Update(enumerator, autoWayPoint);
            }
        }
        return(result);
    }
    public AutoWayPoint PickNextWaypoint(AutoWayPoint currentWaypoint)
    {
        Vector3      vector     = this.get_transform().TransformDirection(Vector3.get_forward());
        AutoWayPoint result     = currentWaypoint;
        float        num        = 10f * (float)-1;
        IEnumerator  enumerator = UnityRuntimeServices.GetEnumerator(currentWaypoint.connected);

        while (enumerator.MoveNext())
        {
            AutoWayPoint autoWayPoint = (AutoWayPoint)RuntimeServices.Coerce(enumerator.Current, typeof(AutoWayPoint));
            Vector3      vector2      = Vector3.Normalize(autoWayPoint.get_transform().get_position() - this.get_transform().get_position());
            UnityRuntimeServices.Update(enumerator, autoWayPoint);
            float num2 = Vector3.Dot(vector2, vector);
            if (num2 > num && autoWayPoint != currentWaypoint)
            {
                num    = num2;
                result = autoWayPoint;
                UnityRuntimeServices.Update(enumerator, autoWayPoint);
            }
        }
        return(result);
    }