public void SetChannel(MegaMorph mr, int index) { switch (index) { case 0: channel = mr.GetChannel(SrcChannel); break; case 1: channel1 = mr.GetChannel(SrcChannel1); break; case 2: channel2 = mr.GetChannel(SrcChannel2); break; case 3: channel3 = mr.GetChannel(SrcChannel3); break; case 4: channel4 = mr.GetChannel(SrcChannel4); break; case 5: channel5 = mr.GetChannel(SrcChannel5); break; case 6: channel6 = mr.GetChannel(SrcChannel6); break; case 7: channel7 = mr.GetChannel(SrcChannel7); break; case 8: channel8 = mr.GetChannel(SrcChannel9); break; case 9: channel9 = mr.GetChannel(SrcChannel9); break; } }
public void SetChannel(MegaMorph mr, int index) { switch ( index ) { case 0: channel = mr.GetChannel(SrcChannel); break; case 1: channel1 = mr.GetChannel(SrcChannel1); break; case 2: channel2 = mr.GetChannel(SrcChannel2); break; case 3: channel3 = mr.GetChannel(SrcChannel3); break; case 4: channel4 = mr.GetChannel(SrcChannel4); break; case 5: channel5 = mr.GetChannel(SrcChannel5); break; case 6: channel6 = mr.GetChannel(SrcChannel6); break; case 7: channel7 = mr.GetChannel(SrcChannel7); break; case 8: channel8 = mr.GetChannel(SrcChannel9); break; case 9: channel9 = mr.GetChannel(SrcChannel9); break; } }
void Start() { MegaMorph mr = GetComponent <MegaMorph>(); if (mr != null) { channel = mr.GetChannel(SrcChannel); channel1 = mr.GetChannel(SrcChannel1); channel2 = mr.GetChannel(SrcChannel2); channel3 = mr.GetChannel(SrcChannel3); channel4 = mr.GetChannel(SrcChannel4); channel5 = mr.GetChannel(SrcChannel5); channel6 = mr.GetChannel(SrcChannel6); channel7 = mr.GetChannel(SrcChannel7); channel8 = mr.GetChannel(SrcChannel9); channel9 = mr.GetChannel(SrcChannel9); } }
public void SetChannel(MegaMorph mr, int index) { switch ( index ) { case 0: channel = mr.GetChannel(SrcChannel); break; case 1: channel1 = mr.GetChannel(SrcChannel1); break; case 2: channel2 = mr.GetChannel(SrcChannel2); break; case 3: channel3 = mr.GetChannel(SrcChannel3); break; case 4: channel4 = mr.GetChannel(SrcChannel4); break; case 5: channel5 = mr.GetChannel(SrcChannel5); break; case 6: channel6 = mr.GetChannel(SrcChannel6); break; case 7: channel7 = mr.GetChannel(SrcChannel7); break; case 8: channel8 = mr.GetChannel(SrcChannel8); break; case 9: channel9 = mr.GetChannel(SrcChannel9); break; case 10: channel10 = mr.GetChannel(SrcChannel10); break; case 11: channel11 = mr.GetChannel(SrcChannel11); break; case 12: channel12 = mr.GetChannel(SrcChannel12); break; case 13: channel13 = mr.GetChannel(SrcChannel13); break; case 14: channel14 = mr.GetChannel(SrcChannel14); break; case 15: channel15 = mr.GetChannel(SrcChannel15); break; case 16: channel16 = mr.GetChannel(SrcChannel16); break; case 17: channel17 = mr.GetChannel(SrcChannel17); break; case 18: channel18 = mr.GetChannel(SrcChannel18); break; case 19: channel19 = mr.GetChannel(SrcChannel19); break; case 20: channel20 = mr.GetChannel(SrcChannel20); break; case 21: channel21 = mr.GetChannel(SrcChannel21); break; case 22: channel22 = mr.GetChannel(SrcChannel22); break; case 23: channel23 = mr.GetChannel(SrcChannel23); break; case 24: channel24 = mr.GetChannel(SrcChannel24); break; case 25: channel25 = mr.GetChannel(SrcChannel25); break; case 26: channel26 = mr.GetChannel(SrcChannel26); break; case 27: channel27 = mr.GetChannel(SrcChannel27); break; case 28: channel28 = mr.GetChannel(SrcChannel28); break; case 29: channel29 = mr.GetChannel(SrcChannel29); break; case 30: channel30 = mr.GetChannel(SrcChannel30); break; case 31: channel31 = mr.GetChannel(SrcChannel31); break; case 32: channel32 = mr.GetChannel(SrcChannel32); break; case 33: channel33 = mr.GetChannel(SrcChannel33); break; case 34: channel34 = mr.GetChannel(SrcChannel34); break; case 35: channel35 = mr.GetChannel(SrcChannel35); break; case 36: channel36 = mr.GetChannel(SrcChannel36); break; case 37: channel37 = mr.GetChannel(SrcChannel37); break; case 38: channel38 = mr.GetChannel(SrcChannel38); break; case 39: channel39 = mr.GetChannel(SrcChannel39); break; case 40: channel40 = mr.GetChannel(SrcChannel40); break; case 41: channel41 = mr.GetChannel(SrcChannel41); break; case 42: channel42 = mr.GetChannel(SrcChannel42); break; case 43: channel43 = mr.GetChannel(SrcChannel43); break; case 44: channel44 = mr.GetChannel(SrcChannel44); break; case 45: channel45 = mr.GetChannel(SrcChannel45); break; case 46: channel46 = mr.GetChannel(SrcChannel46); break; case 47: channel47 = mr.GetChannel(SrcChannel47); break; case 48: channel48 = mr.GetChannel(SrcChannel48); break; case 49: channel49 = mr.GetChannel(SrcChannel49); break; case 50: channel50 = mr.GetChannel(SrcChannel50); break; } }
void Start() { MegaMorph mr = GetComponent <MegaMorph>(); if (mr != null) { channel = mr.GetChannel(SrcChannel); channel1 = mr.GetChannel(SrcChannel1); channel2 = mr.GetChannel(SrcChannel2); channel3 = mr.GetChannel(SrcChannel3); channel4 = mr.GetChannel(SrcChannel4); channel5 = mr.GetChannel(SrcChannel5); channel6 = mr.GetChannel(SrcChannel6); channel7 = mr.GetChannel(SrcChannel7); channel8 = mr.GetChannel(SrcChannel8); channel9 = mr.GetChannel(SrcChannel9); channel10 = mr.GetChannel(SrcChannel10); channel11 = mr.GetChannel(SrcChannel11); channel12 = mr.GetChannel(SrcChannel12); channel13 = mr.GetChannel(SrcChannel13); channel14 = mr.GetChannel(SrcChannel14); channel15 = mr.GetChannel(SrcChannel15); channel16 = mr.GetChannel(SrcChannel16); channel17 = mr.GetChannel(SrcChannel17); channel18 = mr.GetChannel(SrcChannel18); channel19 = mr.GetChannel(SrcChannel19); } }
public void SetChannel(MegaMorph mr, int index) { switch (index) { case 0: channel = mr.GetChannel(SrcChannel); break; case 1: channel1 = mr.GetChannel(SrcChannel1); break; case 2: channel2 = mr.GetChannel(SrcChannel2); break; case 3: channel3 = mr.GetChannel(SrcChannel3); break; case 4: channel4 = mr.GetChannel(SrcChannel4); break; case 5: channel5 = mr.GetChannel(SrcChannel5); break; case 6: channel6 = mr.GetChannel(SrcChannel6); break; case 7: channel7 = mr.GetChannel(SrcChannel7); break; case 8: channel8 = mr.GetChannel(SrcChannel8); break; case 9: channel9 = mr.GetChannel(SrcChannel9); break; case 10: channel10 = mr.GetChannel(SrcChannel10); break; case 11: channel11 = mr.GetChannel(SrcChannel11); break; case 12: channel12 = mr.GetChannel(SrcChannel12); break; case 13: channel13 = mr.GetChannel(SrcChannel13); break; case 14: channel14 = mr.GetChannel(SrcChannel14); break; case 15: channel15 = mr.GetChannel(SrcChannel15); break; case 16: channel16 = mr.GetChannel(SrcChannel16); break; case 17: channel17 = mr.GetChannel(SrcChannel17); break; case 18: channel18 = mr.GetChannel(SrcChannel18); break; case 19: channel19 = mr.GetChannel(SrcChannel19); break; } }
void Start() { MegaMorph mr = GetComponent <MegaMorph>(); if (mr != null) { channel = mr.GetChannel(SrcChannel); channel1 = mr.GetChannel(SrcChannel1); channel2 = mr.GetChannel(SrcChannel2); channel3 = mr.GetChannel(SrcChannel3); channel4 = mr.GetChannel(SrcChannel4); channel5 = mr.GetChannel(SrcChannel5); channel6 = mr.GetChannel(SrcChannel6); channel7 = mr.GetChannel(SrcChannel7); channel8 = mr.GetChannel(SrcChannel8); channel9 = mr.GetChannel(SrcChannel9); channel10 = mr.GetChannel(SrcChannel10); channel11 = mr.GetChannel(SrcChannel11); channel12 = mr.GetChannel(SrcChannel12); channel13 = mr.GetChannel(SrcChannel13); channel14 = mr.GetChannel(SrcChannel14); channel15 = mr.GetChannel(SrcChannel15); channel16 = mr.GetChannel(SrcChannel16); channel17 = mr.GetChannel(SrcChannel17); channel18 = mr.GetChannel(SrcChannel18); channel19 = mr.GetChannel(SrcChannel19); channel20 = mr.GetChannel(SrcChannel20); channel21 = mr.GetChannel(SrcChannel21); channel22 = mr.GetChannel(SrcChannel22); channel23 = mr.GetChannel(SrcChannel23); channel24 = mr.GetChannel(SrcChannel24); channel25 = mr.GetChannel(SrcChannel25); channel26 = mr.GetChannel(SrcChannel26); channel27 = mr.GetChannel(SrcChannel27); channel28 = mr.GetChannel(SrcChannel28); channel29 = mr.GetChannel(SrcChannel29); channel30 = mr.GetChannel(SrcChannel30); channel31 = mr.GetChannel(SrcChannel31); channel32 = mr.GetChannel(SrcChannel32); channel33 = mr.GetChannel(SrcChannel33); channel34 = mr.GetChannel(SrcChannel34); channel35 = mr.GetChannel(SrcChannel35); channel36 = mr.GetChannel(SrcChannel36); channel37 = mr.GetChannel(SrcChannel37); channel38 = mr.GetChannel(SrcChannel38); channel39 = mr.GetChannel(SrcChannel39); channel40 = mr.GetChannel(SrcChannel40); channel41 = mr.GetChannel(SrcChannel41); channel42 = mr.GetChannel(SrcChannel42); channel43 = mr.GetChannel(SrcChannel43); channel44 = mr.GetChannel(SrcChannel44); channel45 = mr.GetChannel(SrcChannel45); channel46 = mr.GetChannel(SrcChannel46); channel47 = mr.GetChannel(SrcChannel47); channel48 = mr.GetChannel(SrcChannel48); channel49 = mr.GetChannel(SrcChannel49); channel50 = mr.GetChannel(SrcChannel50); } }
public void SetChannel(MegaMorph mr, int index) { switch (index) { case 0: channel = mr.GetChannel(SrcChannel); break; case 1: channel1 = mr.GetChannel(SrcChannel1); break; case 2: channel2 = mr.GetChannel(SrcChannel2); break; case 3: channel3 = mr.GetChannel(SrcChannel3); break; case 4: channel4 = mr.GetChannel(SrcChannel4); break; case 5: channel5 = mr.GetChannel(SrcChannel5); break; case 6: channel6 = mr.GetChannel(SrcChannel6); break; case 7: channel7 = mr.GetChannel(SrcChannel7); break; case 8: channel8 = mr.GetChannel(SrcChannel8); break; case 9: channel9 = mr.GetChannel(SrcChannel9); break; case 10: channel10 = mr.GetChannel(SrcChannel10); break; case 11: channel11 = mr.GetChannel(SrcChannel11); break; case 12: channel12 = mr.GetChannel(SrcChannel12); break; case 13: channel13 = mr.GetChannel(SrcChannel13); break; case 14: channel14 = mr.GetChannel(SrcChannel14); break; case 15: channel15 = mr.GetChannel(SrcChannel15); break; case 16: channel16 = mr.GetChannel(SrcChannel16); break; case 17: channel17 = mr.GetChannel(SrcChannel17); break; case 18: channel18 = mr.GetChannel(SrcChannel18); break; case 19: channel19 = mr.GetChannel(SrcChannel19); break; case 20: channel20 = mr.GetChannel(SrcChannel20); break; case 21: channel21 = mr.GetChannel(SrcChannel21); break; case 22: channel22 = mr.GetChannel(SrcChannel22); break; case 23: channel23 = mr.GetChannel(SrcChannel23); break; case 24: channel24 = mr.GetChannel(SrcChannel24); break; case 25: channel25 = mr.GetChannel(SrcChannel25); break; case 26: channel26 = mr.GetChannel(SrcChannel26); break; case 27: channel27 = mr.GetChannel(SrcChannel27); break; case 28: channel28 = mr.GetChannel(SrcChannel28); break; case 29: channel29 = mr.GetChannel(SrcChannel29); break; case 30: channel30 = mr.GetChannel(SrcChannel30); break; case 31: channel31 = mr.GetChannel(SrcChannel31); break; case 32: channel32 = mr.GetChannel(SrcChannel32); break; case 33: channel33 = mr.GetChannel(SrcChannel33); break; case 34: channel34 = mr.GetChannel(SrcChannel34); break; case 35: channel35 = mr.GetChannel(SrcChannel35); break; case 36: channel36 = mr.GetChannel(SrcChannel36); break; case 37: channel37 = mr.GetChannel(SrcChannel37); break; case 38: channel38 = mr.GetChannel(SrcChannel38); break; case 39: channel39 = mr.GetChannel(SrcChannel39); break; case 40: channel40 = mr.GetChannel(SrcChannel40); break; case 41: channel41 = mr.GetChannel(SrcChannel41); break; case 42: channel42 = mr.GetChannel(SrcChannel42); break; case 43: channel43 = mr.GetChannel(SrcChannel43); break; case 44: channel44 = mr.GetChannel(SrcChannel44); break; case 45: channel45 = mr.GetChannel(SrcChannel45); break; case 46: channel46 = mr.GetChannel(SrcChannel46); break; case 47: channel47 = mr.GetChannel(SrcChannel47); break; case 48: channel48 = mr.GetChannel(SrcChannel48); break; case 49: channel49 = mr.GetChannel(SrcChannel49); break; case 50: channel50 = mr.GetChannel(SrcChannel50); break; } }
public void RefreshToolDoppleganger(bool equipping) { if (mDopplegangerLocked) { //rogue call, probably from OnModeChange or something return; } if (!equipping) { BreakDownToolDoppleganger(); //nothing else to do here return; } else if (!HasWorldItem) { BreakDownToolDoppleganger(); } else { //we're equippping and we have a worlditem bool useDoppleganger = true; bool displayAsTool = true; Vector3 equipPos = worlditem.Props.Global.PivotOffset; Vector3 equipRot = worlditem.Props.Global.BaseRotation; //Equippable equippable = null; if (worlditem.Is <Equippable>(out mEquippable)) { displayAsTool = mEquippable.DisplayAsTool; useDoppleganger = mEquippable.UseDoppleganger; //prep these just in case, doesn't cost us much equipPos += mEquippable.EquipOffset; equipRot += mEquippable.EquipRotation; } //now, are we actually using a doppleganger? if (!displayAsTool) { BreakDownToolDoppleganger(); return; } else if (!useDoppleganger) { //alright no doppleganger, but we still equip the worlditem as a tool BreakDownToolDoppleganger(); worlditem.LockTransform(tr); worlditem.tr.localPosition = equipPos; worlditem.tr.localRotation = Quaternion.Euler(equipRot); worlditem.GetComponent <Rigidbody>().isKinematic = true; ToolColliders.AddRange(worlditem.Colliders); //and we're done return; } else { //actually use doppleganger! here we go ToolDoppleganger = WorldItems.GetDoppleganger(worlditem, transform, ToolDoppleganger); ToolColliders.AddRange(ToolDoppleganger.GetComponentsInChildren <Collider>()); ToolActionPointObject = ToolDoppleganger.FindOrCreateChild("ToolActionPointObject"); //the equipped mode will apply equipped etc. offset //so don't bother to set that here ToolDoppleganger.SetActive(true); //get any tension morph animations TensionMorph = ToolDoppleganger.GetComponent <MegaMorph>(); if (TensionMorph != null) { TensionChannel = TensionMorph.GetChannel("Tension"); } //get any projectiles //Weapon weapon = null; if (worlditem.Is <Weapon>(out mWeapon)) { //update our action point //the action point is a gameobject in the weapon that indicates where hits collide //and/or where projectiles launch from - it's safe to access because it's a property ToolActionPointObject.transform.localPosition = mWeapon.ActionPointObject.transform.localPosition; ToolActionPointObject.transform.localRotation = mWeapon.ActionPointObject.transform.localRotation; if (HasProjectile) { //if we've found a projectile, create a doppleganger for it ProjectileDoppleganger = WorldItems.GetDoppleganger( ProjectileObject.PackName, ProjectileObject.PrefabName, ToolActionPointObject.transform, ProjectileDoppleganger, WIMode.Equipped, ProjectileObject.StackName, ProjectileObject.State, ProjectileObject.Subcategory, 1f, WorldClock.TimeOfDayCurrent, WorldClock.TimeOfYearCurrent); ProjectileDoppleganger.SetActive(true); } else if (ProjectileDoppleganger != null) { ProjectileDoppleganger.SetActive(false); } } else if (ProjectileDoppleganger != null) { ProjectileDoppleganger.SetActive(false); } } } }