Here are the examples of the csharp api UnityEngine.Object.Destroy(UnityEngine.Object) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
568 Examples
19
Source : UISlotBase.cs
with Apache License 2.0
from 365082218
with Apache License 2.0
from 365082218
public virtual void OnEndDrag(PointerEventData eventData)
{
// Check if a drag was initialized at all
if (!this.m_DragHasBegan)
return;
// Reset the drag begin bool
this.m_DragHasBegan = false;
// Destroy the dragged icon object
if (this.m_CurrentDraggedObject != null)
{
Destroy(this.m_CurrentDraggedObject);
}
// Reset the variables
this.m_CurrentDraggedObject = null;
this.m_CurrentDraggingPlane = null;
// Use the event
eventData.Use();
// Check if we are returning the icon to the same slot
// By checking if the slot is highlighted
if (this.IsHighlighted(eventData))
return;
// Check if no drop was preformed
if (!this.m_DropPreformed)
{
// Try to throw away the replacedigned content
this.OnThrowAway();
}
else
{
// Reset the drop preformed variable
this.m_DropPreformed = false;
}
}
19
Source : UISelectField.cs
with Apache License 2.0
from 365082218
with Apache License 2.0
from 365082218
protected virtual void ListCleanup()
{
if (this.m_ListObject != null)
Destroy(this.m_ListObject);
this.m_OptionObjects.Clear();
}
19
Source : UISliderExtended.cs
with Apache License 2.0
from 365082218
with Apache License 2.0
from 365082218
protected void ValidateOptions()
{
if (!this.IsActive())
return;
if (!this.HasOptions())
{
// Destroy the options container if we have one
if (this.m_OptionsContGameObject != null)
{
if (Application.isPlaying)
Destroy(this.m_OptionsContGameObject);
else
DestroyImmediate(this.m_OptionsContGameObject);
}
return;
}
// Make sure we have the options container
if (this.m_OptionsContGameObject == null)
this.CreateOptionsContainer();
// Make sure we use whole numbers when using options
if (!this.wholeNumbers)
this.wholeNumbers = true;
// Make sure the max value is the options count, when using options
this.minValue = 0f;
this.maxValue = ((float)this.m_Options.Count - 1f);
// Update the grid properties
this.UpdateGridProperties();
// Update the options properties
this.UpdateOptionsProperties();
}
19
Source : UISliderExtended.cs
with Apache License 2.0
from 365082218
with Apache License 2.0
from 365082218
public void RebuildTextEffects()
{
// Loop through the options
foreach (GameObject optionObject in this.m_OptionGameObjects)
{
Text text = optionObject.GetComponentInChildren<Text>();
if (text != null)
{
Shadow s = text.gameObject.GetComponent<Shadow>();
Outline o = text.gameObject.GetComponent<Outline>();
// Destroy any effect we find
if (Application.isPlaying)
{
if (s != null) Destroy(s);
if (o != null) Destroy(o);
}
else
{
if (s != null) DestroyImmediate(s);
if (o != null) DestroyImmediate(o);
}
// Re-add the effect
this.AddTextEffect(text.gameObject);
}
}
}
19
Source : UISliderExtended.cs
with Apache License 2.0
from 365082218
with Apache License 2.0
from 365082218
protected void DestroyOptions()
{
// Clear out the optins
foreach (GameObject g in this.m_OptionGameObjects)
{
if (Application.isPlaying) Destroy(g);
else DestroyImmediate(g);
}
// Clear the list
this.m_OptionGameObjects.Clear();
}
19
Source : PostEffectsBase.cs
with Apache License 2.0
from activey
with Apache License 2.0
from activey
private void RemoveCreatedMaterials ()
{
while (createdMaterials.Count > 0)
{
Material mat = createdMaterials[0];
createdMaterials.RemoveAt (0);
#if UNITY_EDITOR
DestroyImmediate (mat);
#else
Destroy(mat);
#endif
}
}
19
Source : LoadingMapScreen.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
protected internal override void Draw()
{
Box(screenRect, string.Empty);
rect.Reset();
LabelCenter(rect, locale["loadingLbl"], true);
LabelCenter(rect, locale.Format("loadingProgress", PhotonNetwork.player.CurrentLevel.Length.ToString(), PhotonNetwork.masterClient.CurrentLevel.Length.ToString()), true);
if (Button(rect, locale["disconnect"], false))
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
PhotonNetwork.Disconnect();
}
IN_GAME_MAIN_CAMERA.GameType = GameType.Stop;
FengGameManagerMKII.FGM.gameStart = false;
UnityEngine.Object.Destroy(FengGameManagerMKII.FGM);
Application.LoadLevel("menu");
DisableImmediate();
}
if (PhotonNetwork.player.CurrentLevel.Length >= PhotonNetwork.masterClient.CurrentLevel.Length)
{
DisableImmediate();
RC.CustomLevel.customLevelLoaded = true;
RC.CustomLevel.SpawnPlayerCustomMap();
GameLogic.RacingLogic log = FengGameManagerMKII.FGM.logic as GameLogic.RacingLogic;
if (log != null)
{
if (log.RaceStart)
{
log.TryDestroyDoors();
if (FengGameManagerMKII.Level.Name.StartsWith("Custom-Anarchy"))
{
if (CustomAnarchyLevel.Instance.Scripts.Count > 0)
{
foreach (var anarchyScript in CustomAnarchyLevel.Instance.Scripts)
{
anarchyScript.Launch();
}
}
}
}
}
}
}
19
Source : AnarchyManager.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private IEnumerator OnGameWasOpened()
{
var back = new GameObject("TempBackground").AddComponent<BackgroundOnStart>();
yield return StartCoroutine(Anarchyreplacedets.LoadreplacedetBundle());
Instantiate(Anarchyreplacedets.Load("UIManager"));
Instantiate(Anarchyreplacedets.Load("LoadScreen"));
Destroy(back);
}
19
Source : PausePanel.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
protected override void OnDisable()
{
if (activePanel != null)
{
activePanel.DisableImmediate();
}
activePanel = null;
pauseStyle = null;
pauseRect = null;
if (!AnarchyManager.PauseWindow.IsActive)
{
Time.timeScale = 1f;
}
Screen.lockCursor = leaving ? false : (IN_GAME_MAIN_CAMERA.CameraMode >= CameraType.TPS);
Screen.showCursor = leaving;
IN_GAME_MAIN_CAMERA.isPausing = false;
InputManager.MenuOn = false;
if (IN_GAME_MAIN_CAMERA.MainCamera != null && !IN_GAME_MAIN_CAMERA.MainCamera.enabled)
{
IN_GAME_MAIN_CAMERA.SpecMov.disable = false;
IN_GAME_MAIN_CAMERA.Look.disable = false;
}
if (leaving)
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
PhotonNetwork.Disconnect();
}
IN_GAME_MAIN_CAMERA.GameType = GameType.Stop;
FengGameManagerMKII.FGM.gameStart = false;
Object.Destroy(FengGameManagerMKII.FGM);
Application.LoadLevel("menu");
}
if (!leaving)
{
Configuration.Settings.Apply();
}
}
19
Source : GUIDrawer.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void Disable()
{
if (drawer == null)
{
return;
}
Object.Destroy(drawer);
drawer = null;
}
19
Source : LoadingMapScreen.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
protected internal override void Draw()
{
Box(screenRect, string.Empty);
rect.Reset();
LabelCenter(rect, locale["loadingLbl"], true);
LabelCenter(rect, locale.Format("loadingProgress", PhotonNetwork.player.CurrentLevel.Length.ToString(), PhotonNetwork.masterClient.CurrentLevel.Length.ToString()), true);
if(Button(rect, locale["disconnect"], false))
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Multi)
{
PhotonNetwork.Disconnect();
}
IN_GAME_MAIN_CAMERA.GameType = GameType.Stop;
FengGameManagerMKII.FGM.GameStart = false;
UnityEngine.Object.Destroy(FengGameManagerMKII.FGM);
Application.LoadLevel("menu");
DisableImmediate();
}
if(PhotonNetwork.player.CurrentLevel.Length >= PhotonNetwork.masterClient.CurrentLevel.Length)
{
DisableImmediate();
RC.CustomLevel.customLevelLoaded = true;
if (!FengGameManagerMKII.FGM.NeedChooseSide)
{
if (!PhotonNetwork.player.Isreplacedan)
{
FengGameManagerMKII.FGM.SpawnPlayer(FengGameManagerMKII.FGM.myLastHero);
}
else
{
FengGameManagerMKII.FGM.SpawnNonAIreplacedan("RANDOM");
}
FengGameManagerMKII.FGM.ShowHUDInfoCenter(string.Empty);
} GameLogic.RacingLogic log = FengGameManagerMKII.FGM.Logic as GameLogic.RacingLogic;
if(log != null)
{
if (log.RaceStart)
{
log.TryDestroyDoors();
}
}
}
}
19
Source : Style.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnGUI()
{
if (calls > 3)
{
Destroy(this);
return;
}
UnityEngine.GUI.skin.customStyles = CustomStyles;
calls++;
}
19
Source : LevelTriggerGas.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnTriggerStay(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
other.gameObject.GetComponent<HERO>().FillGas();
UnityEngine.Object.Destroy(base.gameObject);
}
else if (other.gameObject.GetComponent<HERO>().BasePV.IsMine)
{
other.gameObject.GetComponent<HERO>().FillGas();
UnityEngine.Object.Destroy(base.gameObject);
}
else
{
other.gameObject.GetComponent<HERO>().gasUsageTrack = 0f;
}
}
}
19
Source : HERO_DEAD_BODY_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void init(string aniname, float time, BodyParts part)
{
base.animation.Play(aniname);
base.animation[aniname].normalizedTime = time;
base.animation[aniname].speed = 0f;
switch (part)
{
case BodyParts.UPPER:
this.col_upper_arm_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_lower_arm_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_upper_arm_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_lower_arm_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_thigh_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_shin_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_thigh_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_shin_r.GetComponent<CapsuleCollider>().enabled = false;
UnityEngine.Object.Destroy(this.leg);
UnityEngine.Object.Destroy(this.hand_l);
UnityEngine.Object.Destroy(this.hand_r);
UnityEngine.Object.Destroy(this.blood_lower);
UnityEngine.Object.Destroy(this.blood_arm_l);
UnityEngine.Object.Destroy(this.blood_arm_r);
base.gameObject.GetComponent<HERO_SETUP>().CreateHead();
base.gameObject.GetComponent<HERO_SETUP>().CreateUpperBody();
break;
case BodyParts.ARM_L:
this.col_upper_arm_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_lower_arm_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_thigh_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_shin_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_thigh_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_shin_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_head.GetComponent<CapsuleCollider>().enabled = false;
this.col_chest.GetComponent<BoxCollider>().enabled = false;
UnityEngine.Object.Destroy(this.head);
UnityEngine.Object.Destroy(this.chest);
UnityEngine.Object.Destroy(this.leg);
UnityEngine.Object.Destroy(this.hand_r);
UnityEngine.Object.Destroy(this.blood_lower);
UnityEngine.Object.Destroy(this.blood_upper);
UnityEngine.Object.Destroy(this.blood_upper1);
UnityEngine.Object.Destroy(this.blood_upper2);
UnityEngine.Object.Destroy(this.blood_arm_r);
base.gameObject.GetComponent<HERO_SETUP>().CreateLeftArm();
break;
case BodyParts.ARM_R:
this.col_upper_arm_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_lower_arm_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_thigh_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_shin_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_thigh_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_shin_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_head.GetComponent<CapsuleCollider>().enabled = false;
this.col_chest.GetComponent<BoxCollider>().enabled = false;
UnityEngine.Object.Destroy(this.head);
UnityEngine.Object.Destroy(this.chest);
UnityEngine.Object.Destroy(this.leg);
UnityEngine.Object.Destroy(this.hand_l);
UnityEngine.Object.Destroy(this.blood_lower);
UnityEngine.Object.Destroy(this.blood_upper);
UnityEngine.Object.Destroy(this.blood_upper1);
UnityEngine.Object.Destroy(this.blood_upper2);
UnityEngine.Object.Destroy(this.blood_arm_l);
base.gameObject.GetComponent<HERO_SETUP>().CreateRightArm();
break;
case BodyParts.LOWER:
this.col_upper_arm_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_lower_arm_l.GetComponent<CapsuleCollider>().enabled = false;
this.col_upper_arm_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_lower_arm_r.GetComponent<CapsuleCollider>().enabled = false;
this.col_head.GetComponent<CapsuleCollider>().enabled = false;
this.col_chest.GetComponent<BoxCollider>().enabled = false;
UnityEngine.Object.Destroy(this.head);
UnityEngine.Object.Destroy(this.chest);
UnityEngine.Object.Destroy(this.hand_l);
UnityEngine.Object.Destroy(this.hand_r);
UnityEngine.Object.Destroy(this.blood_upper);
UnityEngine.Object.Destroy(this.blood_upper1);
UnityEngine.Object.Destroy(this.blood_upper2);
UnityEngine.Object.Destroy(this.blood_arm_l);
UnityEngine.Object.Destroy(this.blood_arm_r);
base.gameObject.GetComponent<HERO_SETUP>().CreateLowerBody();
break;
}
}
19
Source : HERO_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void Create3DMG()
{
UnityEngine.Object.Destroy(this.part_3dmg);
UnityEngine.Object.Destroy(this.part_3dmg_belt);
UnityEngine.Object.Destroy(this.part_3dmg_gas_l);
UnityEngine.Object.Destroy(this.part_3dmg_gas_r);
UnityEngine.Object.Destroy(this.part_blade_l);
UnityEngine.Object.Destroy(this.part_blade_r);
if (this.myCostume.mesh_3dmg.Length > 0)
{
this.part_3dmg = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.mesh_3dmg));
this.part_3dmg.transform.position = this.mount_3dmg.transform.position;
this.part_3dmg.transform.rotation = this.mount_3dmg.transform.rotation;
this.part_3dmg.transform.parent = this.mount_3dmg.transform.parent;
this.part_3dmg.renderer.material = CharacterMaterials.Materials[this.myCostume._3dmg_texture];
}
if (this.myCostume.mesh_3dmg_belt.Length > 0)
{
this.part_3dmg_belt = this.GenerateCloth(this.reference, "Character/" + this.myCostume.mesh_3dmg_belt);
this.part_3dmg_belt.renderer.material = CharacterMaterials.Materials[this.myCostume._3dmg_texture];
}
if (this.myCostume.mesh_3dmg_gas_l.Length > 0)
{
this.part_3dmg_gas_l = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.mesh_3dmg_gas_l));
if (this.myCostume.uniform_type != UNIFORM_TYPE.CasualAHSS)
{
this.part_3dmg_gas_l.transform.position = this.mount_3dmg_gas_l.transform.position;
this.part_3dmg_gas_l.transform.rotation = this.mount_3dmg_gas_l.transform.rotation;
this.part_3dmg_gas_l.transform.parent = this.mount_3dmg_gas_l.transform.parent;
}
else
{
this.part_3dmg_gas_l.transform.position = this.mount_3dmg_gun_mag_l.transform.position;
this.part_3dmg_gas_l.transform.rotation = this.mount_3dmg_gun_mag_l.transform.rotation;
this.part_3dmg_gas_l.transform.parent = this.mount_3dmg_gun_mag_l.transform.parent;
}
this.part_3dmg_gas_l.renderer.material = CharacterMaterials.Materials[this.myCostume._3dmg_texture];
}
if (this.myCostume.mesh_3dmg_gas_r.Length > 0)
{
this.part_3dmg_gas_r = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.mesh_3dmg_gas_r));
if (this.myCostume.uniform_type != UNIFORM_TYPE.CasualAHSS)
{
this.part_3dmg_gas_r.transform.position = this.mount_3dmg_gas_r.transform.position;
this.part_3dmg_gas_r.transform.rotation = this.mount_3dmg_gas_r.transform.rotation;
this.part_3dmg_gas_r.transform.parent = this.mount_3dmg_gas_r.transform.parent;
}
else
{
this.part_3dmg_gas_r.transform.position = this.mount_3dmg_gun_mag_r.transform.position;
this.part_3dmg_gas_r.transform.rotation = this.mount_3dmg_gun_mag_r.transform.rotation;
this.part_3dmg_gas_r.transform.parent = this.mount_3dmg_gun_mag_r.transform.parent;
}
this.part_3dmg_gas_r.renderer.material = CharacterMaterials.Materials[this.myCostume._3dmg_texture];
}
if (this.myCostume.weapon_l_mesh.Length > 0)
{
this.part_blade_l = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.weapon_l_mesh));
this.part_blade_l.transform.position = this.mount_weapon_l.transform.position;
this.part_blade_l.transform.rotation = this.mount_weapon_l.transform.rotation;
this.part_blade_l.transform.parent = this.mount_weapon_l.transform.parent;
this.part_blade_l.renderer.material = CharacterMaterials.Materials[this.myCostume._3dmg_texture];
if (this.part_blade_l.transform.Find("X-WeaponTrailA"))
{
this.part_blade_l.transform.Find("X-WeaponTrailA").GetComponent<XWeaponTrail>().Deactivate();
this.part_blade_l.transform.Find("X-WeaponTrailB").GetComponent<XWeaponTrail>().Deactivate();
if (base.gameObject.GetComponent<HERO>())
{
base.gameObject.GetComponent<HERO>().leftbladetrail = this.part_blade_l.transform.Find("X-WeaponTrailA").GetComponent<XWeaponTrail>();
base.gameObject.GetComponent<HERO>().leftbladetrail2 = this.part_blade_l.transform.Find("X-WeaponTrailB").GetComponent<XWeaponTrail>();
}
}
}
if (this.myCostume.weapon_r_mesh.Length > 0)
{
this.part_blade_r = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.weapon_r_mesh));
this.part_blade_r.transform.position = this.mount_weapon_r.transform.position;
this.part_blade_r.transform.rotation = this.mount_weapon_r.transform.rotation;
this.part_blade_r.transform.parent = this.mount_weapon_r.transform.parent;
this.part_blade_r.renderer.material = CharacterMaterials.Materials[this.myCostume._3dmg_texture];
if (this.part_blade_r.transform.Find("X-WeaponTrailA"))
{
this.part_blade_r.transform.Find("X-WeaponTrailA").GetComponent<XWeaponTrail>().Deactivate();
this.part_blade_r.transform.Find("X-WeaponTrailB").GetComponent<XWeaponTrail>().Deactivate();
if (base.gameObject.GetComponent<HERO>())
{
base.gameObject.GetComponent<HERO>().rightbladetrail = this.part_blade_r.transform.Find("X-WeaponTrailA").GetComponent<XWeaponTrail>();
base.gameObject.GetComponent<HERO>().rightbladetrail2 = this.part_blade_r.transform.Find("X-WeaponTrailB").GetComponent<XWeaponTrail>();
}
}
}
}
19
Source : HERO_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void CreateHead()
{
UnityEngine.Object.Destroy(this.part_eye);
UnityEngine.Object.Destroy(this.part_face);
UnityEngine.Object.Destroy(this.part_glreplaced);
UnityEngine.Object.Destroy(this.part_hair);
if (!this.IsDeadBody)
{
ClothFactory.DisposeObject(this.part_hair_1);
}
this.CreateHair();
if (this.myCostume.eye_mesh.Length > 0)
{
this.part_eye = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.eye_mesh));
this.part_eye.transform.position = this.part_head.transform.position;
this.part_eye.transform.rotation = this.part_head.transform.rotation;
this.part_eye.transform.parent = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head").transform;
this.SetFacialTexture(this.part_eye, this.myCostume.eye_texture_id);
}
if (this.myCostume.beard_texture_id >= 0)
{
this.CreateFace();
this.SetFacialTexture(this.part_face, this.myCostume.beard_texture_id);
}
if (this.myCostume.glreplaced_texture_id >= 0)
{
this.CreateGlreplaced();
this.SetFacialTexture(this.part_glreplaced, this.myCostume.glreplaced_texture_id);
}
string indexHead = myCostume.skin_texture;
string indexChest = myCostume.skin_texture;
if (!CharacterMaterials.Materials.ContainsKey(indexHead))
{
indexHead = "hair_annie";
}
if (!CharacterMaterials.Materials.ContainsKey(indexChest))
{
indexChest = "aottg_hero_skin_1";
}
this.part_head.renderer.material = CharacterMaterials.Materials[indexHead];
this.part_chest.renderer.material = CharacterMaterials.Materials[indexChest];
}
19
Source : HERO_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void CreateLeftArm()
{
UnityEngine.Object.Destroy(this.part_arm_l);
if (this.myCostume.arm_l_mesh.Length > 0)
{
this.part_arm_l = this.GenerateCloth(this.reference, "Character/" + this.myCostume.arm_l_mesh);
this.part_arm_l.renderer.material = CharacterMaterials.Materials[this.myCostume.body_texture];
}
UnityEngine.Object.Destroy(this.part_hand_l);
if (this.myCostume.hand_l_mesh.Length > 0)
{
this.part_hand_l = this.GenerateCloth(this.reference, "Character/" + this.myCostume.hand_l_mesh);
this.part_hand_l.renderer.material = CharacterMaterials.Materials[this.myCostume.skin_texture];
}
}
19
Source : HERO_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void CreateUpperBody()
{
UnityEngine.Object.Destroy(this.part_upper_body);
UnityEngine.Object.Destroy(this.part_brand_1);
UnityEngine.Object.Destroy(this.part_brand_2);
UnityEngine.Object.Destroy(this.part_brand_3);
UnityEngine.Object.Destroy(this.part_brand_4);
UnityEngine.Object.Destroy(this.part_chest_1);
UnityEngine.Object.Destroy(this.part_chest_2);
if (!this.IsDeadBody)
{
ClothFactory.DisposeObject(this.part_chest_3);
}
this.CreateCape();
if (this.myCostume.part_chest_object_mesh.Length > 0)
{
this.part_chest_1 = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.part_chest_object_mesh));
this.part_chest_1.transform.position = this.chest_info.transform.position;
this.part_chest_1.transform.rotation = this.chest_info.transform.rotation;
this.part_chest_1.transform.parent = base.transform.Find("Amarture/Controller_Body/hip/spine/chest").transform;
this.part_chest_1.renderer.material = CharacterMaterials.Materials[this.myCostume.part_chest_object_texture];
}
if (this.myCostume.part_chest_1_object_mesh.Length > 0)
{
this.part_chest_2 = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.part_chest_1_object_mesh));
this.part_chest_2.transform.position = this.chest_info.transform.position;
this.part_chest_2.transform.rotation = this.chest_info.transform.rotation;
this.part_chest_2.transform.parent = base.transform.Find("Amarture/Controller_Body/hip/spine/chest").transform;
this.part_chest_2.transform.parent = base.transform.Find("Amarture/Controller_Body/hip/spine/chest").transform;
this.part_chest_2.renderer.material = CharacterMaterials.Materials[this.myCostume.part_chest_1_object_texture];
}
if (this.myCostume.part_chest_skinned_cloth_mesh.Length > 0 && !this.IsDeadBody)
{
this.part_chest_3 = ClothFactory.GetCape(this.reference, "Character/" + this.myCostume.part_chest_skinned_cloth_mesh, CharacterMaterials.Materials[this.myCostume.part_chest_skinned_cloth_texture]);
}
if (this.myCostume.body_mesh.Length > 0)
{
this.part_upper_body = this.GenerateCloth(this.reference, "Character/" + this.myCostume.body_mesh);
this.part_upper_body.renderer.material = CharacterMaterials.Materials[this.myCostume.body_texture];
}
if (this.myCostume.brand1_mesh.Length > 0)
{
this.part_brand_1 = this.GenerateCloth(this.reference, "Character/" + this.myCostume.brand1_mesh);
this.part_brand_1.renderer.material = CharacterMaterials.Materials[this.myCostume.brand_texture];
}
if (this.myCostume.brand2_mesh.Length > 0)
{
this.part_brand_2 = this.GenerateCloth(this.reference, "Character/" + this.myCostume.brand2_mesh);
this.part_brand_2.renderer.material = CharacterMaterials.Materials[this.myCostume.brand_texture];
}
if (this.myCostume.brand3_mesh.Length > 0)
{
this.part_brand_3 = this.GenerateCloth(this.reference, "Character/" + this.myCostume.brand3_mesh);
this.part_brand_3.renderer.material = CharacterMaterials.Materials[this.myCostume.brand_texture];
}
if (this.myCostume.brand4_mesh.Length > 0)
{
this.part_brand_4 = this.GenerateCloth(this.reference, "Character/" + this.myCostume.brand4_mesh);
this.part_brand_4.renderer.material = CharacterMaterials.Materials[this.myCostume.brand_texture];
}
this.part_head.renderer.material = CharacterMaterials.Materials[this.myCostume.skin_texture];
this.part_chest.renderer.material = CharacterMaterials.Materials[this.myCostume.skin_texture];
}
19
Source : HERO_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void DeleteCharacterComponent()
{
UnityEngine.Object.Destroy(this.part_eye);
UnityEngine.Object.Destroy(this.part_face);
UnityEngine.Object.Destroy(this.part_glreplaced);
UnityEngine.Object.Destroy(this.part_hair);
bool flag = !this.IsDeadBody;
if (flag)
{
ClothFactory.DisposeObject(this.part_hair_1);
}
UnityEngine.Object.Destroy(this.part_upper_body);
UnityEngine.Object.Destroy(this.part_arm_l);
UnityEngine.Object.Destroy(this.part_arm_r);
bool flag2 = !this.IsDeadBody;
if (flag2)
{
ClothFactory.DisposeObject(this.part_hair_2);
ClothFactory.DisposeObject(this.part_cape);
}
UnityEngine.Object.Destroy(this.part_brand_1);
UnityEngine.Object.Destroy(this.part_brand_2);
UnityEngine.Object.Destroy(this.part_brand_3);
UnityEngine.Object.Destroy(this.part_brand_4);
UnityEngine.Object.Destroy(this.part_chest_1);
UnityEngine.Object.Destroy(this.part_chest_2);
UnityEngine.Object.Destroy(this.part_chest_3);
UnityEngine.Object.Destroy(this.part_3dmg);
UnityEngine.Object.Destroy(this.part_3dmg_belt);
UnityEngine.Object.Destroy(this.part_3dmg_gas_l);
UnityEngine.Object.Destroy(this.part_3dmg_gas_r);
UnityEngine.Object.Destroy(this.part_blade_l);
UnityEngine.Object.Destroy(this.part_blade_r);
}
19
Source : COLOSSAL_TITAN.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void Update()
{
this.healthTime -= Time.deltaTime;
UpdateLabel();
if (this.state == "null")
{
return;
}
if (this.state == "wait")
{
this.waitTime -= Time.deltaTime;
if (this.waitTime <= 0f)
{
baseT.position = new Vector3(30f, 0f, 784f);
//UnityEngine.Object.Instantiate(CacheResources.Load("FX/ThunderCT"), baseT.position + Vectors.up * 350f, Quaternion.Euler(270f, 0f, 0f));
Pool.Enable("FX/ThunderCT", baseT.position + Vectors.up * 350f, Quaternion.Euler(270f, 0f, 0f));
IN_GAME_MAIN_CAMERA.MainCamera.flashBlind();
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
this.idle();
}
else if ((!FengGameManagerMKII.LAN) ? BasePV.IsMine : base.networkView.isMine)
{
this.idle();
}
else
{
this.state = "null";
}
}
}
else
{
if (this.state == "idle")
{
if (this.attackPattern == -1)
{
this.slap("r1");
this.attackPattern++;
}
else if (this.attackPattern == 0)
{
this.attack_sweep(string.Empty);
this.attackPattern++;
}
else if (this.attackPattern == 1)
{
this.steam();
this.attackPattern++;
}
else if (this.attackPattern == 2)
{
this.kick();
this.attackPattern++;
}
else
{
if (this.isSteamNeed || this.hasDie)
{
this.steam();
this.isSteamNeed = false;
return;
}
if (this.myHero == null)
{
this.findNearestHero();
}
else
{
Vector3 vector = this.myHero.transform.position - baseT.position;
float current = -Mathf.Atan2(vector.z, vector.x) * 57.29578f;
float f = -Mathf.DeltaAngle(current, baseGT.rotation.eulerAngles.y - 90f);
this.myDistance = Mathf.Sqrt((this.myHero.transform.position.x - baseT.position.x) * (this.myHero.transform.position.x - baseT.position.x) + (this.myHero.transform.position.z - baseT.position.z) * (this.myHero.transform.position.z - baseT.position.z));
float num = this.myHero.transform.position.y - baseT.position.y;
if (this.myDistance < 85f && UnityEngine.Random.Range(0, 100) < 5)
{
this.steam();
return;
}
if (num > 310f && num < 350f)
{
if (Vector3.Distance(this.myHero.transform.position, baseT.Find("APL1").position) < 40f)
{
this.slap("l1");
return;
}
if (Vector3.Distance(this.myHero.transform.position, baseT.Find("APL2").position) < 40f)
{
this.slap("l2");
return;
}
if (Vector3.Distance(this.myHero.transform.position, baseT.Find("APR1").position) < 40f)
{
this.slap("r1");
return;
}
if (Vector3.Distance(this.myHero.transform.position, baseT.Find("APR2").position) < 40f)
{
this.slap("r2");
return;
}
if (this.myDistance < 150f && Mathf.Abs(f) < 80f)
{
this.attack_sweep(string.Empty);
return;
}
}
if (num < 300f && Mathf.Abs(f) < 80f && this.myDistance < 85f)
{
this.attack_sweep("_vertical");
return;
}
int num2 = UnityEngine.Random.Range(0, 7);
if (num2 == 0)
{
this.slap("l1");
}
else if (num2 == 1)
{
this.slap("l2");
}
else if (num2 == 2)
{
this.slap("r1");
}
else if (num2 == 3)
{
this.slap("r2");
}
else if (num2 == 4)
{
this.attack_sweep(string.Empty);
}
else if (num2 == 5)
{
this.attack_sweep("_vertical");
}
else if (num2 == 6)
{
this.steam();
}
}
}
return;
}
if (this.state == "attack_sweep")
{
if (this.attackCheckTimeA != 0f && ((base.animation["attack_" + this.attackAnimation].normalizedTime >= this.attackCheckTimeA && base.animation["attack_" + this.attackAnimation].normalizedTime <= this.attackCheckTimeB) || (!this.attackChkOnce && base.animation["attack_" + this.attackAnimation].normalizedTime >= this.attackCheckTimeA)))
{
if (!this.attackChkOnce)
{
this.attackChkOnce = true;
}
foreach (RaycastHit raycastHit in this.checkHitCapsule(this.checkHitCapsuleStart.position, this.checkHitCapsuleEnd.position, this.checkHitCapsuleR))
{
GameObject gameObject = raycastHit.collider.gameObject;
if (gameObject.CompareTag("Player"))
{
this.killPlayer(gameObject);
}
if (gameObject.CompareTag("erenHitbox") && this.attackAnimation == "combo_3" && IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && ((!FengGameManagerMKII.LAN) ? PhotonNetwork.IsMasterClient : Network.isServer))
{
gameObject.transform.root.gameObject.GetComponent<replacedAN_EREN>().hitByFTByServer(3);
}
}
foreach (RaycastHit raycastHit2 in this.checkHitCapsule(this.checkHitCapsuleEndOld, this.checkHitCapsuleEnd.position, this.checkHitCapsuleR))
{
GameObject gameObject2 = raycastHit2.collider.gameObject;
if (gameObject2.CompareTag("Player"))
{
this.killPlayer(gameObject2);
}
}
this.checkHitCapsuleEndOld = this.checkHitCapsuleEnd.position;
}
if (base.animation["attack_" + this.attackAnimation].normalizedTime >= 1f)
{
this.sweepSmokeObject.GetComponent<ParticleSystem>().enableEmission = false;
this.sweepSmokeObject.GetComponent<ParticleSystem>().Stop();
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (!FengGameManagerMKII.LAN)
{
BasePV.RPC("stopSweepSmoke", PhotonTargets.Others, new object[0]);
}
}
this.findNearestHero();
this.idle();
this.playAnimation("idle");
}
}
else if (this.state == "kick")
{
if (!this.attackChkOnce && base.animation[this.actionName].normalizedTime >= this.attackCheckTime)
{
this.attackChkOnce = true;
this.door_broken.SetActive(true);
this.door_closed.SetActive(false);
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (!FengGameManagerMKII.LAN)
{
BasePV.RPC("changeDoor", PhotonTargets.OthersBuffered, new object[0]);
}
}
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (FengGameManagerMKII.LAN)
{
Network.Instantiate(CacheResources.Load("FX/boom1_CT_KICK"), baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(270f, 0f, 0f), 0);
Network.Instantiate(CacheResources.Load("rock"), baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(0f, 0f, 0f), 0);
}
else
{
Optimization.Caching.Pool.NetworkEnable("FX/boom1_CT_KICK", baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(270f, 0f, 0f), 0);
Optimization.Caching.Pool.NetworkEnable("rock", baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(0f, 0f, 0f), 0);
}
}
else
{
Pool.Enable("FX/boom1_CT_KICK", baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(270f, 0f, 0f));
//UnityEngine.Object.Instantiate(CacheResources.Load("FX/boom1_CT_KICK"), baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(270f, 0f, 0f));
Pool.Enable("rock", baseT.position + baseT.Forward() * 120f + baseT.right * 30f, Quaternion.Euler(0f, 0f, 0f));
}
}
if (base.animation[this.actionName].normalizedTime >= 1f)
{
this.findNearestHero();
this.idle();
this.playAnimation("idle");
}
}
else if (this.state == "slap")
{
if (!this.attackChkOnce && base.animation["attack_slap_" + this.attackAnimation].normalizedTime >= this.attackCheckTime)
{
this.attackChkOnce = true;
GameObject gameObject3;
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (FengGameManagerMKII.LAN)
{
gameObject3 = (GameObject)Network.Instantiate(CacheResources.Load("FX/boom1"), this.checkHitCapsuleStart.position, Quaternion.Euler(270f, 0f, 0f), 0);
}
else
{
gameObject3 = Optimization.Caching.Pool.NetworkEnable("FX/boom1", this.checkHitCapsuleStart.position, Quaternion.Euler(270f, 0f, 0f), 0);
}
if (gameObject3.GetComponent<EnemyfxIDcontainer>())
{
gameObject3.GetComponent<EnemyfxIDcontainer>().replacedanName = base.name;
}
}
else
{
gameObject3 = Pool.Enable("FX/boom1", this.checkHitCapsuleStart.position, Quaternion.Euler(270f, 0f, 0f));//(GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("FX/boom1"), this.checkHitCapsuleStart.position, Quaternion.Euler(270f, 0f, 0f));
}
gameObject3.transform.localScale = new Vector3(5f, 5f, 5f);
}
if (base.animation["attack_slap_" + this.attackAnimation].normalizedTime >= 1f)
{
this.findNearestHero();
this.idle();
this.playAnimation("idle");
}
}
else if (this.state == "steam")
{
if (!this.attackChkOnce && base.animation[this.actionName].normalizedTime >= this.attackCheckTime)
{
this.attackChkOnce = true;
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (FengGameManagerMKII.LAN)
{
Network.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Up() * 185f, Quaternion.Euler(270f, 0f, 0f), 0);
Network.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Up() * 303f, Quaternion.Euler(270f, 0f, 0f), 0);
Network.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Up() * 50f, Quaternion.Euler(270f, 0f, 0f), 0);
}
else
{
Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam", baseT.position + baseT.Up() * 185f, Quaternion.Euler(270f, 0f, 0f), 0);
Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam", baseT.position + baseT.Up() * 303f, Quaternion.Euler(270f, 0f, 0f), 0);
Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam", baseT.position + baseT.Up() * 50f, Quaternion.Euler(270f, 0f, 0f), 0);
}
}
else
{
Pool.Enable("FX/colossal_steam", baseT.position + baseT.Forward() * 185f, Quaternion.Euler(270f, 0f, 0f));
Pool.Enable("FX/colossal_steam", baseT.position + baseT.Forward() * 303f, Quaternion.Euler(270f, 0f, 0f));
Pool.Enable("FX/colossal_steam", baseT.position + baseT.Forward() * 50f, Quaternion.Euler(270f, 0f, 0f));
//UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Forward() * 185f, Quaternion.Euler(270f, 0f, 0f));
//UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Forward() * 303f, Quaternion.Euler(270f, 0f, 0f));
//UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam"), baseT.position + baseT.Forward() * 50f, Quaternion.Euler(270f, 0f, 0f));
}
}
if (base.animation[this.actionName].normalizedTime >= 1f)
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (FengGameManagerMKII.LAN)
{
Network.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Up() * 185f, Quaternion.Euler(270f, 0f, 0f), 0);
Network.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Up() * 303f, Quaternion.Euler(270f, 0f, 0f), 0);
Network.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Up() * 50f, Quaternion.Euler(270f, 0f, 0f), 0);
}
else
{
GameObject gameObject4 = Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam_dmg", baseT.position + baseT.Up() * 185f, Quaternion.Euler(270f, 0f, 0f), 0);
if (gameObject4.GetComponent<EnemyfxIDcontainer>())
{
gameObject4.GetComponent<EnemyfxIDcontainer>().replacedanName = base.name;
}
gameObject4 = Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam_dmg", baseT.position + baseT.Up() * 303f, Quaternion.Euler(270f, 0f, 0f), 0);
if (gameObject4.GetComponent<EnemyfxIDcontainer>())
{
gameObject4.GetComponent<EnemyfxIDcontainer>().replacedanName = base.name;
}
gameObject4 = Optimization.Caching.Pool.NetworkEnable("FX/colossal_steam_dmg", baseT.position + baseT.Up() * 50f, Quaternion.Euler(270f, 0f, 0f), 0);
if (gameObject4.GetComponent<EnemyfxIDcontainer>())
{
gameObject4.GetComponent<EnemyfxIDcontainer>().replacedanName = base.name;
}
}
}
else
{
Pool.Enable("FX/colossal_steam_dmg", baseT.position + baseT.Forward() * 185f, Quaternion.Euler(270f, 0f, 0f));
Pool.Enable("FX/colossal_steam_dmg", baseT.position + baseT.Forward() * 303f, Quaternion.Euler(270f, 0f, 0f));
Pool.Enable("FX/colossal_steam_dmg", baseT.position + baseT.Forward() * 50f, Quaternion.Euler(270f, 0f, 0f));
//UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Forward() * 185f, Quaternion.Euler(270f, 0f, 0f));
//UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Forward() * 303f, Quaternion.Euler(270f, 0f, 0f));
//UnityEngine.Object.Instantiate(CacheResources.Load("FX/colossal_steam_dmg"), baseT.position + baseT.Forward() * 50f, Quaternion.Euler(270f, 0f, 0f));
}
if (this.hasDie)
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
UnityEngine.Object.Destroy(baseG);
}
else if (FengGameManagerMKII.LAN)
{
if (base.networkView.isMine)
{
}
}
else if (PhotonNetwork.IsMasterClient)
{
PhotonNetwork.Destroy(BasePV);
}
FengGameManagerMKII.FGM.GameWin();
}
this.findNearestHero();
this.idle();
this.playAnimation("idle");
}
}
else if (this.state == string.Empty)
{
}
}
}
19
Source : ClothFactory.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public static void DisposeObject(GameObject cachedObject)
{
bool flag = cachedObject != null;
if (flag)
{
ParentFollow component = cachedObject.GetComponent<ParentFollow>();
bool flag2 = component != null;
if (flag2)
{
bool isActiveInScene = component.isActiveInScene;
if (isActiveInScene)
{
component.isActiveInScene = false;
cachedObject.transform.position = new Vector3(0f, -99999f, 0f);
cachedObject.GetComponent<ParentFollow>().RemoveParent();
}
}
else
{
UnityEngine.Object.Destroy(cachedObject);
}
}
}
19
Source : LevelTriggerGas.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnTriggerStay(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
other.gameObject.GetComponent<HERO>().FillGas();
UnityEngine.Object.Destroy(base.gameObject);
}
else if (other.gameObject.GetComponent<HERO>().BasePV.IsMine)
{
other.gameObject.GetComponent<HERO>().FillGas();
UnityEngine.Object.Destroy(base.gameObject);
}
}
}
19
Source : Bullet.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnDestroy()
{
if (FengGameManagerMKII.FGM != null)
{
FengGameManagerMKII.FGM.RemoveHook(this);
}
if (Myreplacedan != null)
{
Myreplacedan.IsHooked = false;
}
UnityEngine.Object.Destroy(this.rope);
}
19
Source : Bullet.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void SetLinePhase()
{
if (this.master == null)
{
UnityEngine.Object.Destroy(this.rope);
UnityEngine.Object.Destroy(baseG);
return;
}
if (this.nodes.Count <= 0)
{
return;
}
Vector3 a = myRefT.position - nodes[0];
this.lineRenderer.SetVertexCount(this.nodes.Count);
for (int i = 0; i <= this.nodes.Count - 1; i++)
{
this.lineRenderer.SetPosition(i, nodes[i] + a * Mathf.Pow(0.75f, (float)i));
}
if (this.nodes.Count > 1)
{
this.lineRenderer.SetPosition(1, myRefT.position);
}
}
19
Source : Bullet.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void RemoveMe()
{
if (isOnTrap)
{
if (master != null)
{
master.GasMultiplier = 1f;
isOnTrap = false;
}
}
this.isdestroying = true;
if (IN_GAME_MAIN_CAMERA.GameType != GameType.Single && BasePV.IsMine)
{
PhotonNetwork.Destroy(BasePV);
PhotonNetwork.RemoveRPCs(BasePV);
}
else if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
UnityEngine.Object.Destroy(this.rope);
UnityEngine.Object.Destroy(baseG);
}
}
19
Source : TITAN_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
[RPC]
private void setHairPRC(int type, int eye_type, float c1, float c2, float c3)
{
UnityEngine.Object.Destroy(this.part_hair);
this.hair = CostumeHair.hairsM[type];
this.hairType = type;
if (this.hair.hair != string.Empty)
{
GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.hair.hair));
gameObject.transform.parent = this.hair_go_ref.transform.parent;
gameObject.transform.position = this.hair_go_ref.transform.position;
gameObject.transform.rotation = this.hair_go_ref.transform.rotation;
gameObject.transform.localScale = this.hair_go_ref.transform.localScale;
gameObject.renderer.material = CharacterMaterials.Materials[this.hair.texture];
gameObject.renderer.material.color = new Color(c1, c2, c3);
this.part_hair = gameObject;
}
this.setFacialTexture(this.eye, eye_type);
}
19
Source : TITAN_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void setPunkHair()
{
UnityEngine.Object.Destroy(this.part_hair);
this.hair = CostumeHair.hairsM[3];
this.hairType = 3;
GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.hair.hair));
gameObject.transform.parent = this.hair_go_ref.transform.parent;
gameObject.transform.position = this.hair_go_ref.transform.position;
gameObject.transform.rotation = this.hair_go_ref.transform.rotation;
gameObject.transform.localScale = this.hair_go_ref.transform.localScale;
gameObject.renderer.material = CharacterMaterials.Materials[this.hair.texture];
int num = UnityEngine.Random.Range(1, 4);
if (num == 1)
{
gameObject.renderer.material.color = FengColor.hairPunk1;
}
if (num == 2)
{
gameObject.renderer.material.color = FengColor.hairPunk2;
}
if (num == 3)
{
gameObject.renderer.material.color = FengColor.hairPunk3;
}
this.part_hair = gameObject;
this.setFacialTexture(this.eye, 0);
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && BasePV.IsMine)
{
BasePV.RPC("setHairPRC", PhotonTargets.OthersBuffered, new object[]
{
this.hairType,
0,
this.part_hair.renderer.material.color.r,
this.part_hair.renderer.material.color.g,
this.part_hair.renderer.material.color.b
});
}
}
19
Source : HERO_DEAD_BODY_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Update()
{
this.lifetime -= Time.deltaTime;
if (this.lifetime <= 0f)
{
base.gameObject.GetComponent<HERO_SETUP>().DeleteCharacterComponent();
UnityEngine.Object.Destroy(base.gameObject);
}
}
19
Source : BloodSplatterScript.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void Update()
{
if (Input.GetMouseButtonDown(0))
{
this.bloodRotation.Rotate(0f, (float)this.bloodLocalRotationYOffset, 0f);
Transform transform = UnityEngine.Object.Instantiate(this.bloodPrefab, this.bloodPosition.position, this.bloodRotation.rotation) as Transform;
this.bloodInstances = GameObject.FindGameObjectsWithTag("blood");
if (this.bloodInstances.Length >= this.maxAmountBloodPrefabs)
{
UnityEngine.Object.Destroy(this.bloodInstances[0]);
}
}
}
19
Source : HERO_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void CreateHead()
{
UnityEngine.Object.Destroy(this.part_eye);
UnityEngine.Object.Destroy(this.part_face);
UnityEngine.Object.Destroy(this.part_glreplaced);
UnityEngine.Object.Destroy(this.part_hair);
if (!this.IsDeadBody)
{
ClothFactory.DisposeObject(this.part_hair_1);
}
this.CreateHair();
if (this.myCostume.eye_mesh.Length > 0)
{
this.part_eye = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.eye_mesh));
this.part_eye.transform.position = this.part_head.transform.position;
this.part_eye.transform.rotation = this.part_head.transform.rotation;
this.part_eye.transform.parent = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head").transform;
this.SetFacialTexture(this.part_eye, this.myCostume.eye_texture_id);
}
if (this.myCostume.beard_texture_id >= 0)
{
this.CreateFace();
this.SetFacialTexture(this.part_face, this.myCostume.beard_texture_id);
}
if (this.myCostume.glreplaced_texture_id >= 0)
{
this.CreateGlreplaced();
this.SetFacialTexture(this.part_glreplaced, this.myCostume.glreplaced_texture_id);
}
string indexHead = myCostume.skin_texture;
string indexChest = myCostume.skin_texture;
if(!CharacterMaterials.Materials.ContainsKey(indexHead))
{
indexHead = "hair_annie";
}
if (!CharacterMaterials.Materials.ContainsKey(indexChest))
{
indexChest = "aottg_hero_skin_1";
}
this.part_head.renderer.material = CharacterMaterials.Materials[indexHead];
this.part_chest.renderer.material = CharacterMaterials.Materials[indexChest];
}
19
Source : DownloadTexture.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnDestroy()
{
if (this.mMat != null)
{
UnityEngine.Object.Destroy(this.mMat);
}
if (this.mTex != null)
{
UnityEngine.Object.Destroy(this.mTex);
}
}
19
Source : FlareMovement.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Update()
{
this.timer += Time.deltaTime;
if (this.hint != null && hero != null)
{
if (this.timer < 3f)
{
this.hint.transform.position = this.hero.transform.position + this.offY;
Vector3 vector = base.transform.position - this.hint.transform.position;
float num = Mathf.Atan2(-vector.z, vector.x) * 57.29578f;
this.hint.transform.rotation = Quaternion.Euler(-90f, num + 180f, 0f);
}
else if (this.hint != null)
{
UnityEngine.Object.Destroy(this.hint);
}
}
if (this.timer < 4f)
{
base.rigidbody.AddForce((base.transform.Forward() + base.transform.Up() * 5f) * Time.deltaTime * 5f, ForceMode.VelocityChange);
}
else
{
base.rigidbody.AddForce(-base.transform.Up() * Time.deltaTime * 7f, ForceMode.Acceleration);
}
}
19
Source : FlareMovement.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void dontShowHint()
{
UnityEngine.Object.Destroy(this.hint);
this.nohint = true;
}
19
Source : HERO_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void CreateRightArm()
{
UnityEngine.Object.Destroy(this.part_arm_r);
if (this.myCostume.arm_r_mesh.Length > 0)
{
this.part_arm_r = this.GenerateCloth(this.reference, "Character/" + this.myCostume.arm_r_mesh);
this.part_arm_r.renderer.material = CharacterMaterials.Materials[this.myCostume.body_texture];
}
UnityEngine.Object.Destroy(this.part_hand_r);
if (this.myCostume.hand_r_mesh.Length > 0)
{
this.part_hand_r = this.GenerateCloth(this.reference, "Character/" + this.myCostume.hand_r_mesh);
this.part_hand_r.renderer.material = CharacterMaterials.Materials[this.myCostume.skin_texture];
}
}
19
Source : KillInfoComponent.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Update()
{
if (this.start)
{
var dt = Time.deltaTime;
this.timeElapsed += dt;
if (this.timeElapsed < 0.2f)
{
this.baseT.localScale = Vector3.Lerp(this.baseT.localScale, Vector3.one * this.maxScale, dt * 10f);
}
else if (this.timeElapsed < 1f)
{
this.baseT.localScale = Vector3.Lerp(this.baseT.localScale, Vector3.one, dt * 10f);
}
if (this.timeElapsed > this.lifeTime)
{
this.baseT.position += new Vector3(0f, dt * 0.15f, 0f);
this.alpha = 1f - dt * 45f + this.lifeTime - this.timeElapsed;
this.setAlpha(this.alpha);
}
else
{
float num = (float)((int)(100f - (float)Screen.height * 0.5f) + this.col * this.offset);
this.baseT.localPosition = Vector3.Lerp(this.baseT.localPosition, new Vector3(0f, -num, 0f), dt * 10f);
}
if (this.timeElapsed > this.lifeTime + 0.5f)
{
//Optimization.Caching.Pool.Disable(this.baseG);
Destroy(baseG);
}
}
}
19
Source : PVPcheckPoint.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Start()
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
UnityEngine.Object.Destroy(base.gameObject);
return;
}
if (IN_GAME_MAIN_CAMERA.GameMode != GameMode.PVP_CAPTURE)
{
if (BasePV.IsMine)
{
UnityEngine.Object.Destroy(base.gameObject);
}
UnityEngine.Object.Destroy(base.gameObject);
return;
}
PVPcheckPoint.chkPts.Add(this);
IComparer comparer = new IComparerPVPchkPtID();
PVPcheckPoint.chkPts.Sort(comparer);
if (this.humanPt == this.humanPtMax)
{
this.state = CheckPointState.Human;
if (BasePV.IsMine && FengGameManagerMKII.Level.MapName != "The City I")
{
this.supply = Optimization.Caching.Pool.NetworkEnable("aot_supply", base.transform.position - Vectors.up * (base.transform.position.y - this.getHeight(base.transform.position)), base.transform.rotation, 0);
}
}
else if (BasePV.IsMine && !this.hasAnnie)
{
if (UnityEngine.Random.Range(0, 100) < 50)
{
int num = UnityEngine.Random.Range(1, 2);
for (int i = 0; i < num; i++)
{
this.newreplacedan();
}
}
if (this.isBase)
{
this.newreplacedan();
}
}
if (this.replacedanPt == this.replacedanPtMax)
{
this.state = CheckPointState.replacedan;
}
this.hitTestR = 15f * this.size;
base.transform.localScale = new Vector3(this.size, this.size, this.size);
}
19
Source : TITAN_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void setHairVanilla()
{
UnityEngine.Object.Destroy(this.part_hair);
int num = UnityEngine.Random.Range(0, CostumeHair.hairsM.Length);
if (num == 3)
{
num = 9;
}
this.hairType = num;
this.hair = CostumeHair.hairsM[num];
if (this.hair.hair == string.Empty)
{
this.hair = CostumeHair.hairsM[9];
this.hairType = 9;
}
this.part_hair = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.hair.hair));
this.part_hair.transform.parent = this.hair_go_ref.transform.parent;
this.part_hair.transform.position = this.hair_go_ref.transform.position;
this.part_hair.transform.rotation = this.hair_go_ref.transform.rotation;
this.part_hair.transform.localScale = this.hair_go_ref.transform.localScale;
this.part_hair.renderer.material = CharacterMaterials.Materials[this.hair.texture];
this.part_hair.renderer.material.color = HeroCostume.costume[UnityEngine.Random.Range(0, HeroCostume.costume.Length - 5)].hair_color;
int num2 = UnityEngine.Random.Range(1, 8);
this.setFacialTexture(this.eye, num2);
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && BasePV.IsMine)
{
BasePV.RPC("setHairPRC", PhotonTargets.OthersBuffered, new object[]
{
this.hairType,
num2,
this.part_hair.renderer.material.color.r,
this.part_hair.renderer.material.color.g,
this.part_hair.renderer.material.color.b
});
}
}
19
Source : AnarchyManager.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public static void DestroyMainScene()
{
var objectsToDestroy = new[]
{
"PanelLogin",
"LOGIN",
"BG_replacedLE",
"Colossal",
"Icosphere",
"cube",
"colossal",
"CITY",
"city",
"rock",
"AOTTG_HERO",
"Checkbox",
};
var gos = (GameObject[])FindObjectsOfType(typeof(GameObject));
foreach (var name in objectsToDestroy)
{
foreach (var go in gos)
{
if (go.name.Contains(name) ||
(go.GetComponent<UILabel>() != null && go.GetComponent<UILabel>().text.Contains("Snap")) ||
(go.GetComponent<UILabel>() != null && go.GetComponent<UILabel>().text.Contains("Custom")))
{
Destroy(go);
}
}
}
}
19
Source : PlayIdleAnimations.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Start()
{
this.mAnim = base.GetComponentInChildren<Animation>();
if (this.mAnim == null)
{
Debug.LogWarning(NGUITools.GetHierarchy(base.gameObject) + " has no Animation component");
UnityEngine.Object.Destroy(this);
}
else
{
foreach (object obj in this.mAnim)
{
AnimationState animationState = (AnimationState)obj;
if (animationState.clip.name == "idle")
{
animationState.layer = 0;
this.mIdle = animationState.clip;
this.mAnim.Play(this.mIdle.name);
}
else if (animationState.clip.name.StartsWith("idle"))
{
animationState.layer = 1;
this.mBreaks.Add(animationState.clip);
}
}
if (this.mBreaks.Count == 0)
{
UnityEngine.Object.Destroy(this);
}
}
}
19
Source : TypewriterEffect.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Update()
{
if (this.mLabel == null)
{
this.mLabel = base.GetComponent<UILabel>();
this.mLabel.supportEncoding = false;
this.mLabel.symbolStyle = UIFont.SymbolStyle.None;
this.mText = this.mLabel.font.WrapText(this.mLabel.text, (float)this.mLabel.lineWidth / this.mLabel.cachedTransform.localScale.x, this.mLabel.maxLineCount, false, UIFont.SymbolStyle.None);
}
if (this.mOffset < this.mText.Length)
{
if (this.mNextChar <= Time.time)
{
this.charsPerSecond = Mathf.Max(1, this.charsPerSecond);
float num = 1f / (float)this.charsPerSecond;
char c = this.mText[this.mOffset];
if (c == '.' || c == '\n' || c == '!' || c == '?')
{
num *= 4f;
}
this.mNextChar = Time.time + num;
this.mLabel.text = this.mText.Substring(0, ++this.mOffset);
}
}
else
{
UnityEngine.Object.Destroy(this);
}
}
19
Source : HERO_SETUP.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public void CreateHair()
{
UnityEngine.Object.Destroy(this.part_hair);
if (!this.IsDeadBody)
{
ClothFactory.DisposeObject(this.part_hair_1);
}
if (this.myCostume.hair_mesh != string.Empty)
{
this.part_hair = (GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("Character/" + this.myCostume.hair_mesh));
this.part_hair.transform.position = this.part_head.transform.position;
this.part_hair.transform.rotation = this.part_head.transform.rotation;
this.part_hair.transform.parent = base.transform.Find("Amarture/Controller_Body/hip/spine/chest/neck/head").transform;
this.part_hair.renderer.material = CharacterMaterials.Materials[this.myCostume.hairInfo.texture];
this.part_hair.renderer.material.color = this.myCostume.hair_color;
}
if (this.myCostume.hair_1_mesh.Length > 0 && !this.IsDeadBody)
{
string name = "Character/" + this.myCostume.hair_1_mesh;
Material material = CharacterMaterials.Materials[this.myCostume.hairInfo.texture];
this.part_hair_1 = ClothFactory.GetHair(this.reference, name, material, this.myCostume.hair_color);
}
}
19
Source : CubeCollector.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Update()
{
if (GameObject.FindGameObjectWithTag("Player") == null)
{
return;
}
GameObject gameObject = GameObject.FindGameObjectWithTag("Player");
if (Vector3.Distance(gameObject.transform.position, base.transform.position) < 8f)
{
UnityEngine.Object.Destroy(base.gameObject);
}
}
19
Source : LevelMovingBrick.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Start()
{
this.pointA = this.pointGOA.transform.position;
this.pointB = this.pointGOB.transform.position;
UnityEngine.Object.Destroy(this.pointGOA);
UnityEngine.Object.Destroy(this.pointGOB);
}
19
Source : DragDropSurface.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnDrop(GameObject go)
{
DragDropItem component = go.GetComponent<DragDropItem>();
if (component != null)
{
GameObject gameObject = NGUITools.AddChild(base.gameObject, component.prefab);
Transform transform = gameObject.transform;
transform.position = UICamera.lastHit.point;
if (this.rotatePlacedObject)
{
transform.rotation = Quaternion.LookRotation(UICamera.lastHit.normal) * Quaternion.Euler(90f, 0f, 0f);
}
UnityEngine.Object.Destroy(go);
}
}
19
Source : EquipItems.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Start()
{
if (this.itemIDs != null && this.itemIDs.Length > 0)
{
InvEquipment invEquipment = base.GetComponent<InvEquipment>();
if (invEquipment == null)
{
invEquipment = base.gameObject.AddComponent<InvEquipment>();
}
int max = 12;
int i = 0;
int num = this.itemIDs.Length;
while (i < num)
{
int num2 = this.itemIDs[i];
InvBaseItem invBaseItem = InvDatabase.FindByID(num2);
if (invBaseItem != null)
{
invEquipment.Equip(new InvGameItem(num2, invBaseItem)
{
quality = (InvGameItem.Quality)UnityEngine.Random.Range(0, max),
itemLevel = NGUITools.RandomRange(invBaseItem.minItemLevel, invBaseItem.maxItemLevel)
});
}
else
{
Debug.LogWarning("Can't resolve the item ID of " + num2);
}
i++;
}
}
UnityEngine.Object.Destroy(this);
}
19
Source : InvAttachmentPoint.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public GameObject Attach(GameObject prefab)
{
if (this.mPrefab != prefab)
{
this.mPrefab = prefab;
if (this.mChild != null)
{
UnityEngine.Object.Destroy(this.mChild);
}
if (this.mPrefab != null)
{
Transform transform = base.transform;
this.mChild = (UnityEngine.Object.Instantiate(this.mPrefab, transform.position, transform.rotation) as GameObject);
Transform transform2 = this.mChild.transform;
transform2.parent = transform;
transform2.localPosition = Vectors.zero;
transform2.localRotation = Quaternion.idenreplacedy;
transform2.localScale = Vectors.one;
}
}
return this.mChild;
}
19
Source : UIPopupList.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void OnSelect(bool isSelected)
{
if (!isSelected && this.mChild != null)
{
this.mLabelList.Clear();
this.handleEvents = false;
if (this.isAnimated)
{
UIWidget[] componentsInChildren = this.mChild.GetComponentsInChildren<UIWidget>();
int i = 0;
int num = componentsInChildren.Length;
while (i < num)
{
UIWidget uiwidget = componentsInChildren[i];
Color color = uiwidget.color;
color.a = 0f;
TweenColor.Begin(uiwidget.gameObject, 0.15f, color).method = UITweener.Method.EaseOut;
i++;
}
Collider[] componentsInChildren2 = this.mChild.GetComponentsInChildren<Collider>();
int j = 0;
int num2 = componentsInChildren2.Length;
while (j < num2)
{
componentsInChildren2[j].enabled = false;
j++;
}
UnityEngine.Object.Destroy(this.mChild, 0.15f);
}
else
{
UnityEngine.Object.Destroy(this.mChild);
}
this.mBackground = null;
this.mHighlight = null;
this.mChild = null;
}
}
19
Source : Localization.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Awake()
{
if (Localization.mInstance == null)
{
Localization.mInstance = this;
UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
this.currentLanguage = PlayerPrefs.GetString("Language", this.startingLanguage);
if (string.IsNullOrEmpty(this.mLanguage) && this.languages != null && this.languages.Length > 0)
{
this.currentLanguage = this.languages[0].name;
}
}
else
{
UnityEngine.Object.Destroy(base.gameObject);
}
}
19
Source : UpdateManager.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
public static void AddDestroy(UnityEngine.Object obj, float delay)
{
if (obj == null)
{
return;
}
if (Application.isPlaying)
{
if (delay > 0f)
{
UpdateManager.CreateInstance();
UpdateManager.DestroyEntry destroyEntry = new UpdateManager.DestroyEntry();
destroyEntry.obj = obj;
destroyEntry.time = Time.realtimeSinceStartup + delay;
UpdateManager.mInst.mDest.Add(destroyEntry);
}
else
{
UnityEngine.Object.Destroy(obj);
}
}
else
{
UnityEngine.Object.DestroyImmediate(obj);
}
}
19
Source : UIAnchor.cs
with GNU General Public License v3.0
from aelariane
with GNU General Public License v3.0
from aelariane
private void Update()
{
if (this.mAnim != null && this.mAnim.enabled && this.mAnim.isPlaying)
{
return;
}
bool flag = false;
if (this.panelContainer != null)
{
if (this.panelContainer.clipping == UIDrawCall.Clipping.None)
{
float num = (!(this.mRoot != null)) ? 0.5f : ((float)this.mRoot.activeHeight / (float)Screen.height * 0.5f);
this.mRect.xMin = (float)(-(float)Screen.width) * num;
this.mRect.yMin = (float)(-(float)Screen.height) * num;
this.mRect.xMax = -this.mRect.xMin;
this.mRect.yMax = -this.mRect.yMin;
}
else
{
Vector4 clipRange = this.panelContainer.clipRange;
this.mRect.x = clipRange.x - clipRange.z * 0.5f;
this.mRect.y = clipRange.y - clipRange.w * 0.5f;
this.mRect.width = clipRange.z;
this.mRect.height = clipRange.w;
}
}
else if (this.widgetContainer != null)
{
Transform cachedTransform = this.widgetContainer.cachedTransform;
Vector3 localScale = cachedTransform.localScale;
Vector3 localPosition = cachedTransform.localPosition;
Vector3 vector = this.widgetContainer.relativeSize;
Vector3 vector2 = this.widgetContainer.pivotOffset;
vector2.y -= 1f;
vector2.x *= this.widgetContainer.relativeSize.x * localScale.x;
vector2.y *= this.widgetContainer.relativeSize.y * localScale.y;
this.mRect.x = localPosition.x + vector2.x;
this.mRect.y = localPosition.y + vector2.y;
this.mRect.width = vector.x * localScale.x;
this.mRect.height = vector.y * localScale.y;
}
else
{
if (!(this.uiCamera != null))
{
return;
}
flag = true;
this.mRect = this.uiCamera.pixelRect;
}
float x = (this.mRect.xMin + this.mRect.xMax) * 0.5f;
float y = (this.mRect.yMin + this.mRect.yMax) * 0.5f;
Vector3 vector3 = new Vector3(x, y, 0f);
if (this.side != UIAnchor.Side.Center)
{
if (this.side == UIAnchor.Side.Right || this.side == UIAnchor.Side.TopRight || this.side == UIAnchor.Side.BottomRight)
{
vector3.x = this.mRect.xMax;
}
else if (this.side == UIAnchor.Side.Top || this.side == UIAnchor.Side.Center || this.side == UIAnchor.Side.Bottom)
{
vector3.x = x;
}
else
{
vector3.x = this.mRect.xMin;
}
if (this.side == UIAnchor.Side.Top || this.side == UIAnchor.Side.TopRight || this.side == UIAnchor.Side.TopLeft)
{
vector3.y = this.mRect.yMax;
}
else if (this.side == UIAnchor.Side.Left || this.side == UIAnchor.Side.Center || this.side == UIAnchor.Side.Right)
{
vector3.y = y;
}
else
{
vector3.y = this.mRect.yMin;
}
}
float width = this.mRect.width;
float height = this.mRect.height;
vector3.x += this.relativeOffset.x * width;
vector3.y += this.relativeOffset.y * height;
if (flag)
{
if (this.uiCamera.orthographic)
{
vector3.x = Mathf.Round(vector3.x);
vector3.y = Mathf.Round(vector3.y);
if (this.halfPixelOffset && this.mNeedsHalfPixelOffset)
{
vector3.x -= 0.5f;
vector3.y += 0.5f;
}
}
vector3.z = this.uiCamera.WorldToScreenPoint(this.mTrans.position).z;
vector3 = this.uiCamera.ScreenToWorldPoint(vector3);
}
else
{
vector3.x = Mathf.Round(vector3.x);
vector3.y = Mathf.Round(vector3.y);
if (this.panelContainer != null)
{
vector3 = this.panelContainer.cachedTransform.TransformPoint(vector3);
}
else if (this.widgetContainer != null)
{
Transform parent = this.widgetContainer.cachedTransform.parent;
if (parent != null)
{
vector3 = parent.TransformPoint(vector3);
}
}
vector3.z = this.mTrans.position.z;
}
if (this.mTrans.position != vector3)
{
this.mTrans.position = vector3;
}
if (this.runOnlyOnce && Application.isPlaying)
{
UnityEngine.Object.Destroy(this);
}
}
See More Examples