Esempio n. 1
0
 private void resetFireDurations()
 {
     if (this.FX_Fire1)
     {
         spawnParticleController component = this.FX_Fire1.GetComponent <spawnParticleController>();
         if (component)
         {
             component.resetParticleDuration();
         }
     }
     if (this.FX_Fire2)
     {
         spawnParticleController component2 = this.FX_Fire2.GetComponent <spawnParticleController>();
         if (component2)
         {
             component2.resetParticleDuration();
         }
     }
     if (this.FX_Fire3)
     {
         spawnParticleController component3 = this.FX_Fire3.GetComponent <spawnParticleController>();
         if (component3)
         {
             component3.resetParticleDuration();
         }
     }
     if (this.FX_Fire4)
     {
         spawnParticleController component4 = this.FX_Fire4.GetComponent <spawnParticleController>();
         if (component4)
         {
             component4.resetParticleDuration();
         }
     }
 }
Esempio n. 2
0
 public override void Detached()
 {
     if (BoltNetwork.isClient && Scene.MutantControler.activeNetCannibals.Contains(base.gameObject))
     {
         Scene.MutantControler.activeNetCannibals.Remove(base.gameObject);
     }
     if (this.creepy && BoltNetwork.isClient)
     {
         GameObject            gameObject = UnityEngine.Object.Instantiate <GameObject>(this.storePrefab, base.transform.position, base.transform.rotation);
         storeLocalMutantInfo2 component  = gameObject.GetComponent <storeLocalMutantInfo2>();
         Scene.SceneTracker.storedRagDollPrefabs.Add(gameObject);
         component.identifier   = this.storedRagDollName;
         component.rootRotation = this.rootTr.rotation;
         component.rootPosition = this.rootTr.position;
         mutantTransferFire component2 = base.transform.GetComponent <mutantTransferFire>();
         if (component2)
         {
             for (int i = 0; i < component2.clientFireGo.Count; i++)
             {
                 spawnParticleController component3 = component2.clientFireGo[i].GetComponent <spawnParticleController>();
                 if (component3 && component3.spawnedPrefab)
                 {
                     int value = component2.allBones.IndexOf(component2.clientFireGo[i].transform.parent);
                     component.fireIndex.Add(component3.spawnedPrefab.transform, value);
                     component.firePos.Add(component2.clientFireGo[i].transform.localPosition);
                     component.fireRot.Add(component2.clientFireGo[i].transform.localRotation);
                     component3.spawnedPrefab.SendMessage("disableFollowTarget");
                 }
             }
         }
         CoopMutantMaterialSync component4 = base.transform.GetComponent <CoopMutantMaterialSync>();
         if (component4)
         {
             component.matColor = component4.storedColor;
         }
         for (int j = 0; j < this.storedCreepyJoints.Length; j++)
         {
             component.jointAngles.Add(this.storedCreepyJoints[j].localRotation);
         }
         if (this.ast)
         {
             int num = 0;
             foreach (KeyValuePair <Transform, int> keyValuePair in this.ast.stuckArrows)
             {
                 if (keyValuePair.Key)
                 {
                     component.stuckArrowsIndex.Add(keyValuePair.Key, keyValuePair.Value);
                     component.stuckArrowPos.Add(keyValuePair.Key.localPosition);
                     component.stuckArrowRot.Add(keyValuePair.Key.localRotation);
                     if (num < this.ast.stuckArrowsTypeList.Count)
                     {
                         component.stuckArrowType.Add(this.ast.stuckArrowsTypeList[num]);
                     }
                     num++;
                 }
             }
         }
     }
 }
Esempio n. 3
0
    public IEnumerator generateStoredJointList()
    {
        yield return(new WaitForEndOfFrame());

        if (this.doneGenerateList)
        {
            yield break;
        }
        GameObject            store = UnityEngine.Object.Instantiate <GameObject>(this.storePrefab, base.transform.position, base.transform.rotation);
        storeLocalMutantInfo2 slmi  = store.GetComponent <storeLocalMutantInfo2>();

        slmi.identifier = this.cms.storedRagDollName;
        slmi.jointAngles.Clear();
        for (int i = 0; i < this.jointsToSync.Length; i++)
        {
            slmi.jointAngles.Add(this.jointsToSync[i].localRotation);
        }
        CoopMutantMaterialSync cmms = base.transform.parent.GetComponent <CoopMutantMaterialSync>();

        if (cmms)
        {
            slmi.matColor = cmms.storedColor;
        }
        if (this.ast)
        {
            foreach (KeyValuePair <Transform, int> keyValuePair in this.ast.stuckArrows)
            {
                if (keyValuePair.Key)
                {
                    slmi.stuckArrowsIndex.Add(keyValuePair.Key, keyValuePair.Value);
                    slmi.stuckArrowPos.Add(keyValuePair.Key.localPosition);
                    slmi.stuckArrowRot.Add(keyValuePair.Key.localRotation);
                }
            }
        }
        mutantTransferFire mtf = base.transform.parent.GetComponent <mutantTransferFire>();

        if (mtf)
        {
            for (int j = 0; j < mtf.clientFireGo.Count; j++)
            {
                spawnParticleController component = mtf.clientFireGo[j].GetComponent <spawnParticleController>();
                if (component && component.spawnedPrefab)
                {
                    int value = mtf.allBones.IndexOf(mtf.clientFireGo[j].transform.parent);
                    slmi.fireIndex.Add(component.spawnedPrefab.transform, value);
                    slmi.firePos.Add(mtf.clientFireGo[j].transform.localPosition);
                    slmi.fireRot.Add(mtf.clientFireGo[j].transform.localRotation);
                    component.spawnedPrefab.SendMessage("disableFollowTarget");
                }
            }
        }
        Scene.SceneTracker.storedRagDollPrefabs.Add(store);
        this.doneGenerateList = true;
        yield break;
    }
Esempio n. 4
0
    public override void Detached()
    {
        if (!Scene.SceneTracker)
        {
            return;
        }
        GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("storeRagDollPrefab"), base.transform.position, base.transform.rotation);

        gameObject.transform.position = base.transform.position;
        gameObject.transform.rotation = base.transform.rotation;
        storeLocalMutantInfo2 component = gameObject.GetComponent <storeLocalMutantInfo2>();

        Scene.SceneTracker.storedRagDollPrefabs.Add(gameObject);
        if (this.ca.isSnow)
        {
            component.isSnow = true;
        }
        if (!this.ast)
        {
            this.ast = base.transform.GetComponentInChildren <arrowStickToTarget>();
        }
        if (!this.ast)
        {
            this.ast = base.transform.GetComponent <arrowStickToTarget>();
        }
        if (this.ast)
        {
            foreach (KeyValuePair <Transform, int> keyValuePair in this.ast.stuckArrows)
            {
                if (keyValuePair.Key)
                {
                    component.stuckArrowsIndex.Add(keyValuePair.Key, keyValuePair.Value);
                    component.stuckArrowPos.Add(keyValuePair.Key.localPosition);
                    component.stuckArrowRot.Add(keyValuePair.Key.localRotation);
                }
            }
        }
        mutantTransferFire component2 = base.transform.GetComponent <mutantTransferFire>();

        if (component2)
        {
            for (int i = 0; i < component2.clientFireGo.Count; i++)
            {
                spawnParticleController component3 = component2.clientFireGo[i].GetComponent <spawnParticleController>();
                if (component3 && component3.spawnedPrefab)
                {
                    component.fire.Add(component3.spawnedPrefab.transform);
                    component.firePos.Add(component2.clientFireGo[i].transform.localPosition);
                    component.fireRot.Add(component2.clientFireGo[i].transform.localRotation);
                    component3.spawnedPrefab.SendMessage("disableFollowTarget");
                    Debug.Log("detached client fire");
                }
            }
        }
    }
Esempio n. 5
0
    public void transferFireToTarget(GameObject fire, GameObject target)
    {
        spawnParticleController component  = fire.GetComponent <spawnParticleController>();
        mutantTransferFire      component2 = target.GetComponent <mutantTransferFire>();

        if (component && component.spawnedPrefab && component2)
        {
            component.spawnedPrefab.SendMessage("disableFollowTarget");
            int index = this.allBones.IndexOf(fire.transform.parent);
            component.spawnedPrefab.transform.parent        = component2.allBones[index];
            component.spawnedPrefab.transform.localPosition = fire.transform.localPosition;
            component.spawnedPrefab.transform.localRotation = fire.transform.localRotation;
        }
    }