Here are the examples of the csharp api UnityEngine.GameObject.GetComponent() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1129 Examples
19
View Source File : UICharacterSelect_Unit.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 365082218
protected CanvasGroup GetDeleteButtonCavnasGroup()
{
if (this.deleteButton != null)
{
CanvasGroup cg = this.deleteButton.gameObject.GetComponent<CanvasGroup>();
return (cg == null) ? this.deleteButton.gameObject.AddComponent<CanvasGroup>() : cg;
}
return null;
}
19
View Source File : UILoadingBar_OverlayFinish.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 365082218
protected void Start()
{
if (this.targetImage == null || this.bar == null)
{
Debug.LogWarning(this.GetType() + " requires target Image and Test_LoadingBar in order to work.", this);
this.enabled = false;
return;
}
// Make sure our finish has canvas group
if (this.autoVisibility)
{
this.canvasGroup = this.targetImage.gameObject.GetComponent<CanvasGroup>();
if (this.canvasGroup == null) this.canvasGroup = this.targetImage.gameObject.AddComponent<CanvasGroup>();
// Get the default alpha of the target widget
this.defaultFinishAlpha = this.canvasGroup.alpha;
// check if we need to hide the finish
if (this.showAfterPct > 0f)
this.canvasGroup.alpha = (this.targetImage.fillAmount < this.showAfterPct) ? 0f : 1f;
}
// Make sure the image anchor is left
this.targetImage.rectTransform.anchorMin = new Vector2(0f, this.targetImage.rectTransform.anchorMin.y);
this.targetImage.rectTransform.anchorMax = new Vector2(0f, this.targetImage.rectTransform.anchorMax.y);
// Get the default with of the target widget
this.defaultFinishWidth = this.targetImage.rectTransform.rect.width;
// Hook on change event
this.bar.onChange.AddListener(OnBarFillChange);
}
19
View Source File : UITabEditor.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 365082218
private void DrawTargetImageProperties()
{
EditorGUILayout.LabelField("Image Target Properties", EditorStyles.boldLabel);
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
EditorGUILayout.PropertyField(this.m_ImageTargetProperty);
// Check if image is set
if (this.m_ImageTargetProperty.objectReferenceValue != null)
{
Image image = (this.m_ImageTargetProperty.objectReferenceValue as Image);
EditorGUILayout.PropertyField(this.m_ImageTransitionProperty);
// Get the selected transition
Selectable.Transition transition = (Selectable.Transition)this.m_ImageTransitionProperty.enumValueIndex;
if (transition != Selectable.Transition.None)
{
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
if (transition == Selectable.Transition.ColorTint)
{
EditorGUILayout.PropertyField(this.m_ImageColorsProperty);
}
else if (transition == Selectable.Transition.SpriteSwap)
{
EditorGUILayout.PropertyField(this.m_ImageSpriteStateProperty);
}
else if (transition == Selectable.Transition.Animation)
{
EditorGUILayout.PropertyField(this.m_ImageAnimationTriggersProperty);
Animator animator = image.gameObject.GetComponent<Animator>();
if (animator == null || animator.runtimeAnimatorController == null)
{
Rect controlRect = EditorGUILayout.GetControlRect();
controlRect.xMin = (controlRect.xMin + EditorGUIUtility.labelWidth);
if (GUI.Button(controlRect, "Auto Generate Animation", EditorStyles.miniButton))
{
// Generate the animator controller
UnityEditor.Animations.AnimatorController animatorController = UIAnimatorControllerGenerator.GenerateAnimatorContoller(this.m_ImageAnimationTriggersProperty, this.target.name);
if (animatorController != null)
{
if (animator == null)
{
animator = image.gameObject.AddComponent<Animator>();
}
UnityEditor.Animations.AnimatorController.SetAnimatorController(animator, animatorController);
}
}
}
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
19
View Source File : UIEquipReceiver.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 365082218
private UISlotBase ExtractSlot(PointerEventData eventData)
{
if (eventData.pointerPress == null)
return null;
// Try getting slot base component from the selected object
UISlotBase slotBase = eventData.pointerPress.GetComponent<UISlotBase>();
// Check if we failed to get a slot from the pressed game object directly
if (slotBase == null)
slotBase = eventData.pointerPress.GetComponentInChildren<UISlotBase>();
return slotBase;
}
19
View Source File : UISlotBase.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 365082218
public virtual void OnDrop(PointerEventData eventData)
{
// Get the source slot
UISlotBase source = (eventData.pointerPress != null) ? eventData.pointerPress.GetComponent<UISlotBase>() : null;
// Make sure we have the source slot
if (source == null || !source.Isreplacedigned())
return;
// Notify the source that a drop was performed so it does not unreplacedign
source.dropPreformed = true;
// Check if this slot is enabled and it's drag and drop feature is enabled
if (!this.enabled || !this.m_DragAndDropEnabled)
return;
// Prepare a variable indicating whether the replacedign process was successful
bool replacedignSuccess = false;
// Normal empty slot replacedignment
if (!this.Isreplacedigned())
{
// replacedign the target slot with the info from the source
replacedignSuccess = this.replacedign(source);
// Unreplacedign the source on successful replacedignment and the source is not static
if (replacedignSuccess && !source.isStatic)
source.Unreplacedign();
}
// The target slot is replacedigned
else
{
// If the target slot is not static
// and we have a source slot that is not static
if (!this.isStatic && !source.isStatic)
{
// Check if we can swap
if (this.CanSwapWith(source) && source.CanSwapWith(this))
{
// Swap the slots
replacedignSuccess = source.PerformSlotSwap(this);
}
}
// If the target slot is not static
// and the source slot is a static one
else if (!this.isStatic && source.isStatic)
{
replacedignSuccess = this.replacedign(source);
}
}
// If this slot failed to be replacedigned
if (!replacedignSuccess)
{
this.OnreplacedignBySlotFailed(source);
}
// Use the event
eventData.Use();
}
19
View Source File : UISlotBaseEditor.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 365082218
protected void DrawHoverProperties()
{
EditorGUILayout.LabelField("Hovered State Properties", EditorStyles.boldLabel);
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
EditorGUILayout.PropertyField(this.hoverTargetGraphicProperty, new GUIContent("Target Graphic"));
EditorGUILayout.PropertyField(this.hoverTransitionProperty, new GUIContent("Transition"));
Graphic graphic = this.hoverTargetGraphicProperty.objectReferenceValue as Graphic;
UISlotBase.Transition transition = (UISlotBase.Transition)this.hoverTransitionProperty.enumValueIndex;
if (transition != UISlotBase.Transition.None)
{
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
if (transition == UISlotBase.Transition.ColorTint)
{
if (graphic == null)
{
EditorGUILayout.HelpBox("You must have a Graphic target in order to use a color transition.", MessageType.Info);
}
else
{
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(this.hoverNormalColorProperty, new GUIContent("Normal"));
if (EditorGUI.EndChangeCheck())
graphic.canvasRenderer.SetColor(this.hoverNormalColorProperty.colorValue);
EditorGUILayout.PropertyField(this.hoverHighlightColorProperty, new GUIContent("Highlighted"));
EditorGUILayout.PropertyField(this.hoverTransitionDurationProperty, new GUIContent("Duration"));
}
}
else if (transition == UISlotBase.Transition.SpriteSwap)
{
if (graphic as Image == null)
{
EditorGUILayout.HelpBox("You must have a Image target in order to use a sprite swap transition.", MessageType.Info);
}
else
{
EditorGUILayout.PropertyField(this.hoverOverrideSpriteProperty, new GUIContent("Override Sprite"));
}
}
else if (transition == UISlotBase.Transition.Animation)
{
if (graphic == null)
{
EditorGUILayout.HelpBox("You must have a Graphic target in order to use a animation transition.", MessageType.Info);
}
else
{
EditorGUILayout.PropertyField(this.hoverNormalTriggerProperty, new GUIContent("Normal"));
EditorGUILayout.PropertyField(this.hoverHighlightTriggerProperty, new GUIContent("Highlighted"));
Animator animator = graphic.gameObject.GetComponent<Animator>();
if (animator == null || animator.runtimeAnimatorController == null)
{
Rect controlRect = EditorGUILayout.GetControlRect();
controlRect.xMin = (controlRect.xMin + EditorGUIUtility.labelWidth);
if (GUI.Button(controlRect, "Auto Generate Animation", EditorStyles.miniButton))
{
// Generate the animator controller
UnityEditor.Animations.AnimatorController animatorController = this.GenerateHoverAnimatorController();
if (animatorController != null)
{
if (animator == null)
{
animator = graphic.gameObject.AddComponent<Animator>();
}
UnityEditor.Animations.AnimatorController.SetAnimatorController(animator, animatorController);
}
}
}
}
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
19
View Source File : UISlotBaseEditor.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 365082218
protected void DrawPressProperties()
{
EditorGUILayout.LabelField("Pressed State Properties", EditorStyles.boldLabel);
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
EditorGUILayout.PropertyField(this.pressTargetGraphicProperty, new GUIContent("Target Graphic"));
EditorGUILayout.PropertyField(this.pressTransitionProperty, new GUIContent("Transition"));
Graphic graphic = this.pressTargetGraphicProperty.objectReferenceValue as Graphic;
UISlotBase.Transition transition = (UISlotBase.Transition)this.pressTransitionProperty.enumValueIndex;
if (transition != UISlotBase.Transition.None)
{
EditorGUI.indentLevel = (EditorGUI.indentLevel + 1);
if (transition == UISlotBase.Transition.ColorTint)
{
if (graphic == null)
{
EditorGUILayout.HelpBox("You must have a Graphic target in order to use a color transition.", MessageType.Info);
}
else
{
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(this.pressNormalColorProperty, new GUIContent("Normal"));
if (EditorGUI.EndChangeCheck())
graphic.canvasRenderer.SetColor(this.pressNormalColorProperty.colorValue);
EditorGUILayout.PropertyField(this.pressPressColorProperty, new GUIContent("Pressed"));
EditorGUILayout.PropertyField(this.pressTransitionDurationProperty, new GUIContent("Duration"));
EditorGUIUtility.labelWidth = 150f;
EditorGUILayout.PropertyField(this.pressTransitionInstaOutProperty, new GUIContent("Instant Out"));
EditorGUIUtility.labelWidth = 120f;
}
}
else if (transition == UISlotBase.Transition.SpriteSwap)
{
if (graphic as Image == null)
{
EditorGUILayout.HelpBox("You must have a Image target in order to use a sprite swap transition.", MessageType.Info);
}
else
{
EditorGUILayout.PropertyField(this.pressOverrideSpriteProperty, new GUIContent("Override Sprite"));
}
}
else if (transition == UISlotBase.Transition.Animation)
{
if (graphic == null)
{
EditorGUILayout.HelpBox("You must have a Graphic target in order to use a animation transition.", MessageType.Info);
}
else
{
EditorGUILayout.PropertyField(this.pressNormalTriggerProperty, new GUIContent("Normal"));
EditorGUILayout.PropertyField(this.pressPressTriggerProperty, new GUIContent("Pressed"));
Animator animator = graphic.gameObject.GetComponent<Animator>();
if (animator == null || animator.runtimeAnimatorController == null)
{
Rect controlRect = EditorGUILayout.GetControlRect();
controlRect.xMin = (controlRect.xMin + EditorGUIUtility.labelWidth);
if (GUI.Button(controlRect, "Auto Generate Animation", EditorStyles.miniButton))
{
// Generate the animator controller
UnityEditor.Animations.AnimatorController animatorController = this.GeneratePressAnimatorController();
if (animatorController != null)
{
if (animator == null)
{
animator = graphic.gameObject.AddComponent<Animator>();
}
UnityEditor.Animations.AnimatorController.SetAnimatorController(animator, animatorController);
}
}
}
}
}
EditorGUIUtility.labelWidth = 150f;
EditorGUILayout.PropertyField(this.pressForceHoverNormalProperty, new GUIContent("Force Hover Normal"));
EditorGUIUtility.labelWidth = 120f;
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
EditorGUI.indentLevel = (EditorGUI.indentLevel - 1);
}
19
View Source File : UISlotBase.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 365082218
private void TriggerHoverStateAnimation(string triggername)
{
if (this.hoverTargetGraphic == null)
return;
// Get the animator on the target game object
Animator animator = this.hoverTargetGraphic.gameObject.GetComponent<Animator>();
if (animator == null || !animator.isActiveAndEnabled || animator.runtimeAnimatorController == null || string.IsNullOrEmpty(triggername))
return;
animator.ResetTrigger(this.hoverNormalTrigger);
animator.ResetTrigger(this.hoverHighlightTrigger);
animator.SetTrigger(triggername);
}
19
View Source File : UISlotBase.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 365082218
private void TriggerPressStateAnimation(string triggername)
{
if (this.pressTargetGraphic == null)
return;
// Get the animator on the target game object
Animator animator = this.pressTargetGraphic.gameObject.GetComponent<Animator>();
if (animator == null || !animator.isActiveAndEnabled || animator.runtimeAnimatorController == null || string.IsNullOrEmpty(triggername))
return;
animator.ResetTrigger(this.pressNormalTrigger);
animator.ResetTrigger(this.pressPressTrigger);
animator.SetTrigger(triggername);
}
19
View Source File : UISliderExtended.cs
License : Apache License 2.0
Project Creator : 365082218
License : Apache License 2.0
Project Creator : 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
View Source File : ModifyGameItem.cs
License : GNU General Public License v3.0
Project Creator : a2659802
License : GNU General Public License v3.0
Project Creator : a2659802
private IEnumerator Start()
{
yield return new WaitForSceneLoadFinish();
Scene s = USceneManager.GetActiveScene();
foreach (var g in s.GetRootGameObjects())
{
if (g.name.Contains("_Transition") || g.layer == (int)GlobalEnums.PhysLayers.TRANSITION_GATES || g.GetComponent<TransitionPoint>()!=null)
{
if(SetupMode)
g.gameObject.AddComponent<ShowColliders>();
Logger.LogDebug($"Skip gate object:{g.name}");
continue;
}
if (g.GetComponent<CustomDecoration>() != null)
continue;
Destroy(g.gameObject);
}
UnVisableBehaviour.AttackReact.Create(gameObject);
}
19
View Source File : ModifyGameItem.cs
License : GNU General Public License v3.0
Project Creator : a2659802
License : GNU General Public License v3.0
Project Creator : a2659802
private void OnCollisionEnter2D(Collision2D collision)
{
if (collision.gameObject.name.Contains("Slash") || collision.gameObject.name.Contains("Knight") || collision.gameObject.name.Contains("Hero"))
return;
if (collision.gameObject.GetComponent<CustomDecoration>() != null)
return;
collision.gameObject.SetActive(false);
Logger.LogDebug($"Disable {collision.gameObject.name}");
col.enabled = false;
Destroy(gameObject.GetComponent<Rigidbody2D>());
}
19
View Source File : ModifyGameItem.cs
License : GNU General Public License v3.0
Project Creator : a2659802
License : GNU General Public License v3.0
Project Creator : a2659802
private void OnTriggerEnter2D(Collider2D collider)
{
if(collider.gameObject.GetComponent<HazardRespawnTrigger>() == null)
{
//Logger.LogDebug("not respawn box");
return;
}
collider.gameObject.SetActive(false);
Logger.LogDebug($"Disable respawn Trigger {collider.gameObject.name}");
col.enabled = false;
}
19
View Source File : DepthOfFieldDeprecatedEditor.cs
License : Apache License 2.0
Project Creator : activey
License : Apache License 2.0
Project Creator : activey
public override void OnInspectorGUI () {
serObj.Update ();
GameObject go = (target as DepthOfFieldDeprecated).gameObject;
if (!go)
return;
if (!go.GetComponent<Camera>())
return;
if (simpleTweakMode.boolValue)
GUILayout.Label ("Current: "+go.GetComponent<Camera>().name+", near "+go.GetComponent<Camera>().nearClipPlane+", far: "+go.GetComponent<Camera>().farClipPlane+", focal: "+focalPoint.floatValue, EditorStyles.miniBoldLabel);
else
GUILayout.Label ("Current: "+go.GetComponent<Camera>().name+", near "+go.GetComponent<Camera>().nearClipPlane+", far: "+go.GetComponent<Camera>().farClipPlane+", focal: "+focalZDistance.floatValue, EditorStyles.miniBoldLabel);
EditorGUILayout.PropertyField (resolution, new GUIContent("Resolution"));
EditorGUILayout.PropertyField (quality, new GUIContent("Quality"));
EditorGUILayout.PropertyField (simpleTweakMode, new GUIContent("Simple tweak"));
EditorGUILayout.PropertyField (visualizeCoc, new GUIContent("Visualize focus"));
EditorGUILayout.PropertyField (bokeh, new GUIContent("Enable bokeh"));
EditorGUILayout.Separator ();
GUILayout.Label ("Focal Settings", EditorStyles.boldLabel);
if (simpleTweakMode.boolValue) {
focalPoint.floatValue = EditorGUILayout.Slider ("Focal distance", focalPoint.floatValue, go.GetComponent<Camera>().nearClipPlane, go.GetComponent<Camera>().farClipPlane);
EditorGUILayout.PropertyField (objectFocus, new GUIContent("Transform"));
EditorGUILayout.PropertyField (smoothness, new GUIContent("Smoothness"));
focalSize.floatValue = EditorGUILayout.Slider ("Focal size", focalSize.floatValue, 0.0f, (go.GetComponent<Camera>().farClipPlane - go.GetComponent<Camera>().nearClipPlane));
}
else {
focalZDistance.floatValue = EditorGUILayout.Slider ("Distance", focalZDistance.floatValue, go.GetComponent<Camera>().nearClipPlane, go.GetComponent<Camera>().farClipPlane);
EditorGUILayout.PropertyField (objectFocus, new GUIContent("Transform"));
focalSize.floatValue = EditorGUILayout.Slider ("Size", focalSize.floatValue, 0.0f, (go.GetComponent<Camera>().farClipPlane - go.GetComponent<Camera>().nearClipPlane));
focalStartCurve.floatValue = EditorGUILayout.Slider ("Start curve", focalStartCurve.floatValue, 0.05f, 20.0f);
focalEndCurve.floatValue = EditorGUILayout.Slider ("End curve", focalEndCurve.floatValue, 0.05f, 20.0f);
}
EditorGUILayout.Separator ();
GUILayout.Label ("Blur (Fore- and Background)", EditorStyles.boldLabel);
EditorGUILayout.PropertyField (bluriness, new GUIContent("Blurriness"));
EditorGUILayout.PropertyField (maxBlurSpread, new GUIContent("Blur spread"));
if (quality.enumValueIndex > 0) {
EditorGUILayout.PropertyField (foregroundBlurExtrude, new GUIContent("Foreground size"));
}
EditorGUILayout.Separator ();
if (bokeh.boolValue) {
EditorGUILayout.Separator ();
GUILayout.Label ("Bokeh Settings", EditorStyles.boldLabel);
EditorGUILayout.PropertyField (bokehDestination, new GUIContent("Destination"));
bokehIntensity.floatValue = EditorGUILayout.Slider ("Intensity", bokehIntensity.floatValue, 0.0f, 1.0f);
bokehThresholdLuminance.floatValue = EditorGUILayout.Slider ("Min luminance", bokehThresholdLuminance.floatValue, 0.0f, 0.99f);
bokehThresholdContrast.floatValue = EditorGUILayout.Slider ("Min contrast", bokehThresholdContrast.floatValue, 0.0f, 0.25f);
bokehDownsample.intValue = EditorGUILayout.IntSlider ("Downsample", bokehDownsample.intValue, 1, 3);
bokehScale.floatValue = EditorGUILayout.Slider ("Size scale", bokehScale.floatValue, 0.0f, 20.0f);
EditorGUILayout.PropertyField (bokehTexture , new GUIContent("Texture mask"));
}
serObj.ApplyModifiedProperties();
}
19
View Source File : GenericMoveCamera.cs
License : Apache License 2.0
Project Creator : activey
License : Apache License 2.0
Project Creator : activey
public void Start() {
if (LookAtTarget == null) {
_Forward = new Movement(aAmount => gameObject.transform.Translate(Vector3.forward*aAmount), () => ForwardDampenRate);
} else {
_Forward = new Movement(aAmount => gameObject.GetComponent<UnityEngine.Camera>().fieldOfView += aAmount, () => ForwardDampenRate);
}
_PanX = new Movement(aAmount => gameObject.transform.Translate(Vector3.left*aAmount), () => PanningDampenRate);
_PanY = new Movement(aAmount => gameObject.transform.Translate(Vector3.up*aAmount), () => PanningDampenRate);
_RotateX = new Movement(aAmount => gameObject.transform.Rotate(Vector3.up*aAmount), () => RotateDampenRate);
_RotateY = new Movement(aAmount => gameObject.transform.Rotate(Vector3.left*aAmount), () => RotateDampenRate);
}
19
View Source File : GenericMoveCamera.cs
License : Apache License 2.0
Project Creator : activey
License : Apache License 2.0
Project Creator : activey
public void Update() {
if (!Operational)
return;
GetInputs.QueryInputSystem();
Vector3 START_POSITION = gameObject.transform.position;
if (GetInputs.ResetMovement) {
ResetMovement();
} else {
float MAG = (GetInputs.isSlowModifier ? ControlKeyMagnification : 1f)*(GetInputs.isFastModifier ? ShiftKeyMagnification : 1f);
if (GetInputs.isPanLeft) {
_PanX.ChangeVelocity(0.01f*MAG*_Resolution*PanLeftRightSensitivity);
} else if (GetInputs.isPanRight) {
_PanX.ChangeVelocity(-0.01f*MAG*_Resolution*PanLeftRightSensitivity);
}
if ( _PanX != null )
_PanX.Update();
if (GetInputs.isMoveForward ) {
_Forward.ChangeVelocity(0.005f*MAG*_Resolution*MovementSpeedMagnification);
} else if (GetInputs.isMoveBackward ) {
_Forward.ChangeVelocity(-0.005f*MAG*_Resolution*MovementSpeedMagnification);
}
if (GetInputs.isMoveForwardAlt) {
_Forward.ChangeVelocity(0.005f*MAG*_Resolution*MovementSpeedMagnification*WheelMouseMagnification);
} else if (GetInputs.isMoveBackwardAlt) {
_Forward.ChangeVelocity(-0.005f*MAG*_Resolution*MovementSpeedMagnification*WheelMouseMagnification);
}
if (GetInputs.isPanUp) {
_PanY.ChangeVelocity(0.005f*MAG*_Resolution*PanUpDownSensitivity);
} else if (GetInputs.isPanDown) {
_PanY.ChangeVelocity(-0.005f*MAG*_Resolution*PanUpDownSensitivity);
}
bool FORWARD_LOCK = GetInputs.isLockForwardMovement && ForwardMovementLockEnabled;
_Forward.Update(!FORWARD_LOCK);
_PanY.Update();
// Pan
if (GetInputs.isRotateAction) {
float X = (Input.mousePosition.x - GetInputs.RotateActionStart.x)/Screen.width*MouseRotationSensitivity;
float Y = (Input.mousePosition.y - GetInputs.RotateActionStart.y)/Screen.height*MouseRotationSensitivity;
_RotateX.SetVelocity(X*MAG*RotationMagnification*_Resolution);
_RotateY.SetVelocity(Y*MAG*RotationMagnification*_Resolution);
}
_RotateX.Update();
_RotateY.Update();
}
// Lock at object
if (LookAtTarget != null ) {
transform.LookAt(LookAtTarget.transform);
if (gameObject.GetComponent<UnityEngine.Camera>().fieldOfView < MinimumZoom) {
ResetMovement();
gameObject.GetComponent<UnityEngine.Camera>().fieldOfView = MinimumZoom;
} else if (gameObject.GetComponent<UnityEngine.Camera>().fieldOfView > MaximumZoom) {
ResetMovement();
gameObject.GetComponent<UnityEngine.Camera>().fieldOfView = MaximumZoom;
}
}
// Set ranges
Vector3 END_POSITION = transform.position;
if (LockX)
END_POSITION.x = START_POSITION.x;
if (LockY)
END_POSITION.y = START_POSITION.y;
if (LockZ)
END_POSITION.z = START_POSITION.z;
if (UseXRange && gameObject.transform.position.x < XRangeMin) END_POSITION.x = XRangeMin;
if (UseXRange && gameObject.transform.position.x > XRangeMax) END_POSITION.x = XRangeMax;
if (UseYRange && gameObject.transform.position.y < YRangeMin) END_POSITION.y = YRangeMin;
if (UseYRange && gameObject.transform.position.y > YRangeMax) END_POSITION.y = YRangeMax;
if (UseZRange && gameObject.transform.position.z < ZRangeMin) END_POSITION.z = ZRangeMin;
if (UseZRange && gameObject.transform.position.z > ZRangeMax) END_POSITION.z = ZRangeMax;
transform.position = END_POSITION;
// Level Camera
if (LevelCamera)
LevelTheCamera();
}
19
View Source File : CameraMotionBlur.cs
License : Apache License 2.0
Project Creator : activey
License : Apache License 2.0
Project Creator : activey
Camera GetTmpCam () {
if (tmpCam == null) {
string name = "_" + _camera.name + "_MotionBlurTmpCam";
GameObject go = GameObject.Find (name);
if (null == go) // couldn't find, recreate
tmpCam = new GameObject (name, typeof (Camera));
else
tmpCam = go;
}
tmpCam.hideFlags = HideFlags.DontSave;
tmpCam.transform.position = _camera.transform.position;
tmpCam.transform.rotation = _camera.transform.rotation;
tmpCam.transform.localScale = _camera.transform.localScale;
tmpCam.GetComponent<Camera>().CopyFrom(_camera);
tmpCam.GetComponent<Camera>().enabled = false;
tmpCam.GetComponent<Camera>().depthTextureMode = DepthTextureMode.None;
tmpCam.GetComponent<Camera>().clearFlags = CameraClearFlags.Nothing;
return tmpCam.GetComponent<Camera>();
}
19
View Source File : SpectateCommand.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
public void EnterSpecMode(bool enter)
{
if (enter)
{
spectateSprites = new List<GameObject>();
UnityEngine.Object[] array = UnityEngine.Object.FindObjectsOfType(typeof(GameObject));
for (int i = 0; i < array.Length; i++)
{
GameObject gameObject = (GameObject)array[i];
if (!(gameObject.GetComponent<UISprite>() != null) || !gameObject.activeInHierarchy)
{
continue;
}
string text = gameObject.name;
if (text.Contains("blade") || text.Contains("bullet") || text.Contains("gas") || text.Contains("flare") || text.Contains("skill_cd"))
{
if (!spectateSprites.Contains(gameObject))
{
spectateSprites.Add(gameObject);
}
gameObject.SetActive(value: false);
}
}
string[] array2 = new string[2]
{
"Flare",
"LabelInfoBottomRight"
};
string[] array3 = array2;
foreach (string text2 in array3)
{
GameObject gameObject2 = GameObject.Find(text2);
if (gameObject2 != null)
{
if (!spectateSprites.Contains(gameObject2))
{
spectateSprites.Add(gameObject2);
}
gameObject2.SetActive(value: false);
}
}
foreach (HERO player in FengGameManagerMKII.Heroes)
{
if (player.BasePV.IsMine)
{
PhotonNetwork.Destroy(player.BasePV);
}
}
if (PhotonNetwork.player.Isreplacedan && !PhotonNetwork.player.Dead)
{
foreach (replacedAN replacedan in FengGameManagerMKII.replacedans)
{
if (replacedan.BasePV.IsMine)
{
PhotonNetwork.Destroy(replacedan.BasePV);
}
}
}
NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[1], state: false);
NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[2], state: false);
NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[3], state: false);
FengGameManagerMKII.FGM.needChooseSide = false;
Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().enabled = true;
if (IN_GAME_MAIN_CAMERA.CameraMode == CameraType.ORIGINAL)
{
Screen.lockCursor = false;
Screen.showCursor = false;
}
GameObject gameObject3 = GameObject.FindGameObjectWithTag("Player");
if (gameObject3 != null && gameObject3.GetComponent<HERO>() != null)
{
Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().SetMainObject(gameObject3.GetComponent<HERO>());
}
else
{
Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().SetMainObject(null);
}
Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().setSpectorMode(val: false);
Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().gameOver = true;
}
else
{
if (GameObject.Find("cross1") != null)
{
GameObject.Find("cross1").transform.localPosition = Vector3.up * 5000f;
}
if (spectateSprites != null)
{
foreach (GameObject spectateSprite in spectateSprites)
{
if (spectateSprite != null)
{
spectateSprite.SetActive(value: true);
}
}
}
spectateSprites = new List<GameObject>();
NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[1], state: false);
NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[2], state: false);
NGUITools.SetActive(FengGameManagerMKII.UIRefer.panels[3], state: false);
FengGameManagerMKII.FGM.needChooseSide = true;
Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().SetMainObject(null);
Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().setSpectorMode(val: true);
Camera.main.GetComponent<IN_GAME_MAIN_CAMERA>().gameOver = true;
}
}
19
View Source File : AnarchyManager.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : 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
View Source File : AHSSShotGunCollider.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void OnTriggerStay(Collider other)
{
if (!isLocal)
{
return;
}
if (this.active_me)
{
switch (other.gameObject.tag)
{
case "playerHitbox":
if (!FengGameManagerMKII.Level.PVPEnabled)
{
return;
}
float num = 1f - Vector3.Distance(other.gameObject.transform.position, baseT.position) * 0.05f;
num = Mathf.Min(1f, num);
HitBox component = other.gameObject.GetComponent<HitBox>();
if (component != null && component.transform.root != null)
{
if (component.transform.root.GetComponent<HERO>().myTeam == this.myTeam)
{
return;
}
if (!component.transform.root.GetComponent<HERO>().IsInvincible())
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!component.transform.root.GetComponent<HERO>().IsGrabbed)
{
component.transform.root.GetComponent<HERO>().Die((component.transform.root.transform.position - baseT.position).normalized * num * 1000f + Vectors.up * 50f, false);
}
}
else if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && !component.transform.root.GetComponent<HERO>().HasDied() && !component.transform.root.GetComponent<HERO>().IsGrabbed)
{
component.transform.root.GetComponent<HERO>().MarkDie();
component.transform.root.GetComponent<HERO>().BasePV.RPC("netDie", PhotonTargets.All, new object[]
{
(component.transform.root.position - baseT.position).normalized * num * 1000f + Vectors.up * 50f,
false,
this.viewID,
this.ownerName,
false
});
}
}
}
break;
case "replacedanneck":
HitBox component2 = other.gameObject.GetComponent<HitBox>();
if (component2 != null && this.checkIfBehind(component2.transform.root.gameObject) && !this.currentHits.Contains(component2))
{
component2.hitPosition = (baseT.position + component2.transform.position) * 0.5f;
this.currentHits.Add(component2);
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (component2.transform.root.GetComponent<replacedAN>() && !component2.transform.root.GetComponent<replacedAN>().hasDie)
{
int num2 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num2 = Mathf.Max(10, num2);
FengGameManagerMKII.FGM.netShowDamage(num2);
if ((float)num2 > component2.transform.root.GetComponent<replacedAN>().myLevel * 100f)
{
component2.transform.root.GetComponent<replacedAN>().Die();
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num2)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num2, component2.transform.root.gameObject, 0.02f);
}
FengGameManagerMKII.FGM.PlayerKillInfoSingleUpdate(num2);
}
}
}
else if (!PhotonNetwork.IsMasterClient || !component2.transform.root.GetComponent<PhotonView>().BasePV.IsMine)
{
if (component2.transform.root.GetComponent<replacedAN>())
{
if (!component2.transform.root.GetComponent<replacedAN>().hasDie)
{
int num3 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num3 = Mathf.Max(10, num3);
if ((float)num3 > component2.transform.root.GetComponent<replacedAN>().myLevel * 100f)
{
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num3)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num3, component2.transform.root.gameObject, 0.02f);
component2.transform.root.GetComponent<replacedAN>().asClientLookTarget = false;
}
component2.transform.root.GetComponent<replacedAN>().BasePV.RPC("replacedanGetHit", component2.transform.root.GetComponent<replacedAN>().BasePV.owner, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num3
});
}
}
}
else if (component2.transform.root.GetComponent<FEMALE_replacedAN>())
{
int num4 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num4 = Mathf.Max(10, num4);
if (!component2.transform.root.GetComponent<FEMALE_replacedAN>().hasDie)
{
component2.transform.root.GetComponent<FEMALE_replacedAN>().BasePV.RPC("replacedanGetHit", component2.transform.root.GetComponent<FEMALE_replacedAN>().BasePV.owner, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num4
});
}
}
else if (component2.transform.root.GetComponent<COLOSSAL_replacedAN>() && !component2.transform.root.GetComponent<COLOSSAL_replacedAN>().hasDie)
{
int num5 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num5 = Mathf.Max(10, num5);
component2.transform.root.GetComponent<COLOSSAL_replacedAN>().BasePV.RPC("replacedanGetHit", component2.transform.root.GetComponent<COLOSSAL_replacedAN>().BasePV.owner, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num5
});
}
}
else if (component2.transform.root.GetComponent<replacedAN>())
{
if (!component2.transform.root.GetComponent<replacedAN>().hasDie)
{
int num6 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num6 = Mathf.Max(10, num6);
if ((float)num6 > component2.transform.root.GetComponent<replacedAN>().myLevel * 100f)
{
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num6)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num6, component2.transform.root.gameObject, 0.02f);
}
component2.transform.root.GetComponent<replacedAN>().replacedanGetHit(baseT.root.gameObject.GetPhotonView().viewID, num6);
}
}
}
else if (component2.transform.root.GetComponent<FEMALE_replacedAN>())
{
if (!component2.transform.root.GetComponent<FEMALE_replacedAN>().hasDie)
{
int num7 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num7 = Mathf.Max(10, num7);
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num7)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num7, null, 0.02f);
}
component2.transform.root.GetComponent<FEMALE_replacedAN>().replacedanGetHit(baseT.root.gameObject.GetPhotonView().viewID, num7);
}
}
else if (component2.transform.root.GetComponent<COLOSSAL_replacedAN>() && !component2.transform.root.GetComponent<COLOSSAL_replacedAN>().hasDie)
{
int num8 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num8 = Mathf.Max(10, num8);
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num8)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num8, null, 0.02f);
}
component2.transform.root.GetComponent<COLOSSAL_replacedAN>().replacedanGetHit(baseT.root.gameObject.GetPhotonView().viewID, num8);
}
this.showCriticalHitFX(other.gameObject.transform.position);
}
break;
case "erenHitbox":
if (this.dmg > 0 && !other.gameObject.transform.root.gameObject.GetComponent<replacedAN_EREN>().ireplaced)
{
other.gameObject.transform.root.gameObject.GetComponent<replacedAN_EREN>().hitByreplacedan();
}
break;
case "replacedaneye":
if (!this.currentHits.Contains(other.gameObject))
{
this.currentHits.Add(other.gameObject);
GameObject gameObject = other.gameObject.transform.root.gameObject;
if (gameObject.GetComponent<FEMALE_replacedAN>())
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!gameObject.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject.GetComponent<FEMALE_replacedAN>().hitEye();
}
}
else if (!PhotonNetwork.IsMasterClient || !gameObject.GetPhotonView().IsMine)
{
if (!gameObject.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject.GetComponent<FEMALE_replacedAN>().BasePV.RPC("hitEyeRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID
});
}
}
else if (!gameObject.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject.GetComponent<FEMALE_replacedAN>().hitEyeRPC(baseT.root.gameObject.GetPhotonView().viewID);
}
}
else if (gameObject.GetComponent<replacedAN>().abnormalType != AbnormalType.Crawler)
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!gameObject.GetComponent<replacedAN>().hasDie)
{
gameObject.GetComponent<replacedAN>().HitEye();
}
}
else if (!PhotonNetwork.IsMasterClient || !gameObject.GetPhotonView().IsMine)
{
if (!gameObject.GetComponent<replacedAN>().hasDie)
{
gameObject.GetComponent<replacedAN>().BasePV.RPC("hitEyeRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID
});
}
}
else if (!gameObject.GetComponent<replacedAN>().hasDie)
{
gameObject.GetComponent<replacedAN>().hitEyeRPC(baseT.root.gameObject.GetPhotonView().viewID);
}
this.showCriticalHitFX(other.gameObject.transform.position);
}
}
break;
case "replacedanankle":
if (currentHits.Contains(other.gameObject))
{
return;
}
this.currentHits.Add(other.gameObject);
GameObject gameObject2 = other.gameObject.transform.root.gameObject;
int num9 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - gameObject2.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num9 = Mathf.Max(10, num9);
if (gameObject2.GetComponent<replacedAN>() && gameObject2.GetComponent<replacedAN>().abnormalType != AbnormalType.Crawler)
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!gameObject2.GetComponent<replacedAN>().hasDie)
{
gameObject2.GetComponent<replacedAN>().HitAnkle();
}
}
else
{
if (!PhotonNetwork.IsMasterClient || !gameObject2.GetPhotonView().IsMine)
{
if (!gameObject2.GetComponent<replacedAN>().hasDie)
{
gameObject2.GetComponent<replacedAN>().BasePV.RPC("hitAnkleRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID
});
}
}
else if (!gameObject2.GetComponent<replacedAN>().hasDie)
{
gameObject2.GetComponent<replacedAN>().HitAnkle();
}
this.showCriticalHitFX(other.gameObject.transform.position);
}
}
else if (gameObject2.GetComponent<FEMALE_replacedAN>())
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (other.gameObject.name == "ankleR")
{
if (gameObject2.GetComponent<FEMALE_replacedAN>() && !gameObject2.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject2.GetComponent<FEMALE_replacedAN>().hitAnkleR(num9);
}
}
else if (gameObject2.GetComponent<FEMALE_replacedAN>() && !gameObject2.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject2.GetComponent<FEMALE_replacedAN>().hitAnkleL(num9);
}
}
else if (other.gameObject.name == "ankleR")
{
if (!PhotonNetwork.IsMasterClient)
{
if (!gameObject2.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject2.GetComponent<FEMALE_replacedAN>().BasePV.RPC("hitAnkleRRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num9
});
}
}
else if (!gameObject2.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject2.GetComponent<FEMALE_replacedAN>().hitAnkleRRPC(baseT.root.gameObject.GetPhotonView().viewID, num9);
}
}
else if (!PhotonNetwork.IsMasterClient)
{
if (!gameObject2.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject2.GetComponent<FEMALE_replacedAN>().BasePV.RPC("hitAnkleLRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num9
});
}
}
else if (!gameObject2.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject2.GetComponent<FEMALE_replacedAN>().hitAnkleLRPC(baseT.root.gameObject.GetPhotonView().viewID, num9);
}
this.showCriticalHitFX(other.gameObject.transform.position);
}
break;
}
}
}
19
View Source File : AHSSShotGunCollider.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void Start()
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (!baseT.root.gameObject.GetPhotonView().IsMine)
{
base.enabled = false;
return;
}
if (baseT.root.gameObject.GetComponent<EnemyfxIDcontainer>() != null)
{
this.viewID = baseT.root.gameObject.GetComponent<EnemyfxIDcontainer>().myOwnerViewID;
this.ownerName = baseT.root.gameObject.GetComponent<EnemyfxIDcontainer>().replacedanName;
this.myTeam = PhotonView.Find(this.viewID).gameObject.GetComponent<HERO>().myTeam;
}
}
else
{
this.myTeam = IN_GAME_MAIN_CAMERA.MainHERO.myTeam;
}
this.active_me = true;
this.count = 0;
}
19
View Source File : BodyPushBox.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void OnTriggerStay(Collider other)
{
if (other.gameObject.CompareTag("bodyCollider"))
{
BodyPushBox component = other.gameObject.GetComponent<BodyPushBox>();
if (component && component.parent)
{
Vector3 vector = component.parent.transform.position - this.parent.transform.position;
float radius = base.gameObject.GetComponent<CapsuleCollider>().radius;
float radius2 = base.gameObject.GetComponent<CapsuleCollider>().radius;
vector.y = 0f;
float num;
if (vector.magnitude > 0f)
{
num = radius + radius2 - vector.magnitude;
vector.Normalize();
}
else
{
num = radius + radius2;
vector.x = 1f;
}
if (num < 0.1f)
{
}
}
}
}
19
View Source File : EnemyCheckCollider.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void OnTriggerStay(Collider other)
{
if ((IN_GAME_MAIN_CAMERA.GameType == GameType.Single || base.transform.root.gameObject.GetPhotonView().IsMine) && this.active_me)
{
if (other.gameObject.tag == "playerHitbox")
{
float b = 1f - Vector3.Distance(other.gameObject.transform.position, base.transform.position) * 0.05f;
b = Mathf.Min(1f, b);
HitBox component = other.gameObject.GetComponent<HitBox>();
if (component != null && component.transform.root != null)
{
if (this.dmg == 0)
{
Vector3 vector = component.transform.root.transform.position - base.transform.position;
float num2 = 0f;
if (base.gameObject.GetComponent<SphereCollider>() != null)
{
num2 = base.transform.localScale.x * base.gameObject.GetComponent<SphereCollider>().radius;
}
if (base.gameObject.GetComponent<CapsuleCollider>() != null)
{
num2 = base.transform.localScale.x * base.gameObject.GetComponent<CapsuleCollider>().height;
}
float num3 = 5f;
if (num2 > 0f)
{
num3 = Mathf.Max(5f, num2 - vector.magnitude);
}
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
component.transform.root.GetComponent<HERO>().blowAway(vector.normalized * num3 + Vector3.up * 1f);
return;
}
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
object[] parameters = new object[]
{
vector.normalized * num3 + Vector3.up * 1f
};
component.transform.root.GetComponent<HERO>().BasePV.RPC("blowAway", PhotonTargets.All, parameters);
return;
}
}
else if (!component.transform.root.GetComponent<HERO>().IsInvincible())
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!component.transform.root.GetComponent<HERO>().IsGrabbed)
{
Vector3 vector2 = component.transform.root.transform.position - base.transform.position;
component.transform.root.GetComponent<HERO>().Die(vector2.normalized * b * 1000f + Vector3.up * 50f, this.isThisBite);
return;
}
}
else if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && !component.transform.root.GetComponent<HERO>().HasDied() && !component.transform.root.GetComponent<HERO>().IsGrabbed)
{
component.transform.root.GetComponent<HERO>().MarkDie();
int myOwnerViewID = -1;
string replacedanName = string.Empty;
if (base.transform.root.gameObject.GetComponent<EnemyfxIDcontainer>() != null)
{
myOwnerViewID = base.transform.root.gameObject.GetComponent<EnemyfxIDcontainer>().myOwnerViewID;
replacedanName = base.transform.root.gameObject.GetComponent<EnemyfxIDcontainer>().replacedanName;
}
object[] objArray2 = new object[]
{
(component.transform.root.position - base.transform.position).normalized * b * 1000f + Vector3.up * 50f,
this.isThisBite,
myOwnerViewID,
replacedanName,
true
};
component.transform.root.GetComponent<HERO>().BasePV.RPC("netDie", PhotonTargets.All, objArray2);
return;
}
}
}
}
else if (other.gameObject.tag == "erenHitbox" && this.dmg > 0 && !other.gameObject.transform.root.gameObject.GetComponent<replacedAN_EREN>().ireplaced)
{
other.gameObject.transform.root.gameObject.GetComponent<replacedAN_EREN>().hitByreplacedan();
}
}
}
19
View Source File : LevelBottom.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void OnTriggerStay(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
if (this.type == BottomType.Die)
{
if (other.gameObject.GetComponent<HERO>())
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (other.gameObject.GetPhotonView().IsMine)
{
other.gameObject.GetComponent<HERO>().NetDieSpecial(base.rigidbody.velocity * 50f, false, -1, IN_GAME_MAIN_CAMERA.GameMode == GameMode.Racing ? Anarchy.User.AkinaKillTrigger.PickRandomString() : Anarchy.User.ForestLavaKillTrigger.PickRandomString(), true);
}
}
else
{
other.gameObject.GetComponent<HERO>().Die(other.gameObject.rigidbody.velocity * 50f, false);
}
}
}
else if (this.type == BottomType.Teleport)
{
if (this.link != null)
{
other.gameObject.transform.position = this.link.transform.position;
}
else
{
other.gameObject.transform.position = Vectors.zero;
}
}
}
}
19
View Source File : TriggerColliderWeapon.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void OnTriggerStay(Collider other)
{
//if (this.ActiveMe)
//{
if (!this.currentHitsII.Contains(other.gameObject))
{
this.currentHitsII.Add(other.gameObject);
IN_GAME_MAIN_CAMERA.MainCamera.startShake(0.1f, 0.1f, 0.95f);
if (other.gameObject.transform.root.gameObject.CompareTag("replacedan"))
{
IN_GAME_MAIN_CAMERA.MainHERO.slashHit.Play();
if (IN_GAME_MAIN_CAMERA.GameType != GameType.Single)
{
Optimization.Caching.Pool.NetworkEnable("hitMeat", baseT.position, Quaternion.Euler(270f, 0f, 0f), 0);
}
else
{
Pool.Enable("hitMeat", baseT.position, Quaternion.Euler(270f, 0f, 0f));//(GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("hitMeat"));
}
//gameObject.transform.position = baseT.position;
baseT.root.GetComponent<HERO>().useBlade(0);
}
}
switch (other.gameObject.tag)
{
case "playerHitbox":
if (!FengGameManagerMKII.Level.PVPEnabled)
{
return;
}
float num = 1f - Vector3.Distance(other.gameObject.transform.position, baseT.position) * 0.05f;
num = Mathf.Min(1f, num);
HitBox component = other.gameObject.GetComponent<HitBox>();
if (component != null && component.transform.root != null)
{
if (component.transform.root.GetComponent<HERO>().myTeam == this.myTeam)
{
return;
}
if (!component.transform.root.GetComponent<HERO>().IsInvincible())
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!component.transform.root.GetComponent<HERO>().IsGrabbed)
{
component.transform.root.GetComponent<HERO>().Die((component.transform.root.transform.position - baseT.position).normalized * num * 1000f + Vectors.up * 50f, false);
}
}
else if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && !component.transform.root.GetComponent<HERO>().HasDied() && !component.transform.root.GetComponent<HERO>().IsGrabbed)
{
component.transform.root.GetComponent<HERO>().MarkDie();
component.transform.root.GetComponent<HERO>().BasePV.RPC("netDie", PhotonTargets.All, new object[]
{
(component.transform.root.position - baseT.position).normalized * num * 1000f + Vectors.up * 50f,
false,
baseT.root.gameObject.GetPhotonView().viewID,
PhotonView.Find(baseT.root.gameObject.GetPhotonView().viewID).owner.Properties[PhotonPlayerProperty.name],
false
});
}
}
}
break;
case "replacedanneck":
HitBox component2 = other.gameObject.GetComponent<HitBox>();
if (component2 != null && this.checkIfBehind(component2.transform.root.gameObject) && !this.currentHits.Contains(component2))
{
component2.hitPosition = (baseT.position + component2.transform.position) * 0.5f;
this.currentHits.Add(component2);
this.meatDie.Play();
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (component2.transform.root.GetComponent<replacedAN>() && !component2.transform.root.GetComponent<replacedAN>().hasDie)
{
int num2 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num2 = Mathf.Max(10, num2);
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num2)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num2, component2.transform.root.gameObject, 0.02f);
}
component2.transform.root.GetComponent<replacedAN>().Die();
this.napeMeat(IN_GAME_MAIN_CAMERA.MainR.velocity, component2.transform.root);
FengGameManagerMKII.FGM.netShowDamage(num2);
FengGameManagerMKII.FGM.PlayerKillInfoSingleUpdate(num2);
}
}
else if (!PhotonNetwork.IsMasterClient || !component2.transform.root.gameObject.GetPhotonView().IsMine)
{
if (component2.transform.root.GetComponent<replacedAN>())
{
if (!component2.transform.root.GetComponent<replacedAN>().hasDie)
{
int num3 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num3 = Mathf.Max(10, num3);
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num3)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num3, component2.transform.root.gameObject, 0.02f);
component2.transform.root.GetComponent<replacedAN>().asClientLookTarget = false;
}
component2.transform.root.GetComponent<replacedAN>().BasePV.RPC("replacedanGetHit", component2.transform.root.GetComponent<replacedAN>().BasePV.owner, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num3
});
}
}
else if (component2.transform.root.GetComponent<FEMALE_replacedAN>())
{
baseT.root.GetComponent<HERO>().useBlade(int.MaxValue);
int num4 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num4 = Mathf.Max(10, num4);
if (!component2.transform.root.GetComponent<FEMALE_replacedAN>().hasDie)
{
component2.transform.root.GetComponent<FEMALE_replacedAN>().BasePV.RPC("replacedanGetHit", component2.transform.root.GetComponent<FEMALE_replacedAN>().BasePV.owner, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num4
});
}
}
else if (component2.transform.root.GetComponent<COLOSSAL_replacedAN>())
{
baseT.root.GetComponent<HERO>().useBlade(int.MaxValue);
if (!component2.transform.root.GetComponent<COLOSSAL_replacedAN>().hasDie)
{
int num5 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num5 = Mathf.Max(10, num5);
component2.transform.root.GetComponent<COLOSSAL_replacedAN>().BasePV.RPC("replacedanGetHit", component2.transform.root.GetComponent<COLOSSAL_replacedAN>().BasePV.owner, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num5
});
}
}
}
else if (component2.transform.root.GetComponent<replacedAN>())
{
if (!component2.transform.root.GetComponent<replacedAN>().hasDie)
{
int num6 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num6 = Mathf.Max(10, num6);
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num6)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num6, component2.transform.root.gameObject, 0.02f);
}
component2.transform.root.GetComponent<replacedAN>().replacedanGetHit(baseT.root.gameObject.GetPhotonView().viewID, num6);
}
}
else if (component2.transform.root.GetComponent<FEMALE_replacedAN>())
{
baseT.root.GetComponent<HERO>().useBlade(int.MaxValue);
if (!component2.transform.root.GetComponent<FEMALE_replacedAN>().hasDie)
{
int num7 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num7 = Mathf.Max(10, num7);
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num7)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num7, null, 0.02f);
}
component2.transform.root.GetComponent<FEMALE_replacedAN>().replacedanGetHit(baseT.root.gameObject.GetPhotonView().viewID, num7);
}
}
else if (component2.transform.root.GetComponent<COLOSSAL_replacedAN>())
{
baseT.root.GetComponent<HERO>().useBlade(int.MaxValue);
if (!component2.transform.root.GetComponent<COLOSSAL_replacedAN>().hasDie)
{
int num8 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - component2.transform.root.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num8 = Mathf.Max(10, num8);
if (Settings.Snapshots.ToValue() && Settings.SnapshotsDamage.Value <= num8)
{
IN_GAME_MAIN_CAMERA.MainCamera.startSnapShot(component2.transform.position, num8, null, 0.02f);
}
component2.transform.root.GetComponent<COLOSSAL_replacedAN>().replacedanGetHit(baseT.root.gameObject.GetPhotonView().viewID, num8);
}
}
this.showCriticalHitFX();
}
break;
case "replacedaneye":
if (!this.currentHits.Contains(other.gameObject))
{
this.currentHits.Add(other.gameObject);
GameObject gameObject2 = other.gameObject.transform.root.gameObject;
if (gameObject2.GetComponent<FEMALE_replacedAN>())
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!gameObject2.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject2.GetComponent<FEMALE_replacedAN>().hitEye();
}
}
else if (!PhotonNetwork.IsMasterClient)
{
if (!gameObject2.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject2.GetComponent<FEMALE_replacedAN>().BasePV.RPC("hitEyeRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID
});
}
}
else if (!gameObject2.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject2.GetComponent<FEMALE_replacedAN>().hitEyeRPC(baseT.root.gameObject.GetPhotonView().viewID);
}
}
else if (gameObject2.GetComponent<replacedAN>().abnormalType != AbnormalType.Crawler)
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!gameObject2.GetComponent<replacedAN>().hasDie)
{
gameObject2.GetComponent<replacedAN>().HitEye();
}
}
else if (!PhotonNetwork.IsMasterClient || !gameObject2.GetPhotonView().IsMine)
{
if (!gameObject2.GetComponent<replacedAN>().hasDie)
{
gameObject2.GetComponent<replacedAN>().BasePV.RPC("hitEyeRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID
});
}
}
else if (!gameObject2.GetComponent<replacedAN>().hasDie)
{
gameObject2.GetComponent<replacedAN>().hitEyeRPC(baseT.root.gameObject.GetPhotonView().viewID);
}
this.showCriticalHitFX();
}
}
break;
case "replacedanankle":
if (currentHits.Contains(other.gameObject))
{
return;
}
this.currentHits.Add(other.gameObject);
GameObject gameObject3 = other.gameObject.transform.root.gameObject;
int num9 = (int)((IN_GAME_MAIN_CAMERA.MainR.velocity - gameObject3.rigidbody.velocity).magnitude * 10f * this.scoreMulti);
num9 = Mathf.Max(10, num9);
if (gameObject3.GetComponent<replacedAN>() && gameObject3.GetComponent<replacedAN>().abnormalType != AbnormalType.Crawler)
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!gameObject3.GetComponent<replacedAN>().hasDie)
{
gameObject3.GetComponent<replacedAN>().HitAnkle();
}
}
else
{
if (!PhotonNetwork.IsMasterClient || !gameObject3.GetPhotonView().IsMine)
{
if (!gameObject3.GetComponent<replacedAN>().hasDie)
{
gameObject3.GetComponent<replacedAN>().BasePV.RPC("hitAnkleRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID
});
}
}
else if (!gameObject3.GetComponent<replacedAN>().hasDie)
{
gameObject3.GetComponent<replacedAN>().HitAnkle();
}
this.showCriticalHitFX();
}
}
else if (gameObject3.GetComponent<FEMALE_replacedAN>())
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (other.gameObject.name == "ankleR")
{
if (gameObject3.GetComponent<FEMALE_replacedAN>() && !gameObject3.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject3.GetComponent<FEMALE_replacedAN>().hitAnkleR(num9);
}
}
else if (gameObject3.GetComponent<FEMALE_replacedAN>() && !gameObject3.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject3.GetComponent<FEMALE_replacedAN>().hitAnkleL(num9);
}
}
else if (other.gameObject.name == "ankleR")
{
if (!PhotonNetwork.IsMasterClient)
{
if (!gameObject3.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject3.GetComponent<FEMALE_replacedAN>().BasePV.RPC("hitAnkleRRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num9
});
}
}
else if (!gameObject3.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject3.GetComponent<FEMALE_replacedAN>().hitAnkleRRPC(baseT.root.gameObject.GetPhotonView().viewID, num9);
}
}
else if (!PhotonNetwork.IsMasterClient)
{
if (!gameObject3.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject3.GetComponent<FEMALE_replacedAN>().BasePV.RPC("hitAnkleLRPC", PhotonTargets.MasterClient, new object[]
{
baseT.root.gameObject.GetPhotonView().viewID,
num9
});
}
}
else if (!gameObject3.GetComponent<FEMALE_replacedAN>().hasDie)
{
gameObject3.GetComponent<FEMALE_replacedAN>().hitAnkleLRPC(baseT.root.gameObject.GetPhotonView().viewID, num9);
}
this.showCriticalHitFX();
}
break;
}
//}
}
19
View Source File : LevelTriggerCheckPoint.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void OnTriggerStay(Collider other)
{
if (other.gameObject.CompareTag("Player"))
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
RCManager.racingSpawnPointSet = true;
RCManager.racingSpawnPoint = transform.position;
RCManager.racingSpawnPointRotation = transform.rotation;
}
else if (other.gameObject.GetComponent<HERO>().BasePV.IsMine)
{
RCManager.racingSpawnPointSet = true;
RCManager.racingSpawnPoint = transform.position;
RCManager.racingSpawnPointRotation = transform.rotation;
}
}
}
19
View Source File : LevelTriggerGas.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : 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
View Source File : RacingCheckpointTrigger.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void OnTriggerEnter(Collider other)
{
GameObject gameObj = other.gameObject;
var hero = gameObj.transform.root.gameObject.GetComponent<HERO>();
if (hero == null)
{
return;
}
switch (gameObj.layer)
{
case Layers.PlayersN:
if (CustomLevel.RacingCP.Count == 0 || CustomLevel.RacingCP.Peek() != this)
{
CustomLevel.RacingCP.Push(this);
RCManager.racingSpawnPointRotation = gameObj.transform.rotation;
Anarchy.UI.Chat.Add($"<color=#{User.MainColor}>Checkpoint[<color=#{User.SubColor}>" + CustomLevel.RacingCP.Count + "</color>] set</color>");
}
gameObj.GetComponent<HERO>().FillGas();
RCManager.racingSpawnPoint = base.gameObject.transform.position;
RCManager.racingSpawnPointSet = true;
break;
case Layers.NetworkObjectN:
hero.gasUsageTrack = 0;
break;
}
}
19
View Source File : ClothFactory.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : 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
View Source File : ClothFactory.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
public static GameObject GetCape(GameObject reference, string name, Material material)
{
List<GameObject> list;
bool flag = ClothFactory.clothCache.TryGetValue(name, out list);
GameObject result;
if (flag)
{
for (int i = 0; i < list.Count; i++)
{
GameObject gameObject = list[i];
bool flag2 = gameObject == null;
if (flag2)
{
list.RemoveAt(i);
i = Mathf.Max(i - 1, 0);
}
else
{
ParentFollow component = gameObject.GetComponent<ParentFollow>();
bool flag3 = !component.isActiveInScene;
if (flag3)
{
component.isActiveInScene = true;
gameObject.renderer.material = material;
gameObject.GetComponent<Cloth>().enabled = true;
gameObject.GetComponent<SkinnedMeshRenderer>().enabled = true;
gameObject.GetComponent<ParentFollow>().SetParent(reference.transform);
ClothFactory.ReapplyClothBones(reference, gameObject);
return gameObject;
}
}
}
GameObject gameObject2 = ClothFactory.GenerateCloth(reference, name);
gameObject2.renderer.material = material;
gameObject2.AddComponent<ParentFollow>().SetParent(reference.transform);
list.Add(gameObject2);
ClothFactory.clothCache[name] = list;
result = gameObject2;
}
else
{
GameObject gameObject2 = ClothFactory.GenerateCloth(reference, name);
gameObject2.renderer.material = material;
gameObject2.AddComponent<ParentFollow>().SetParent(reference.transform);
list = new List<GameObject>
{
gameObject2
};
ClothFactory.clothCache.Add(name, list);
result = gameObject2;
}
return result;
}
19
View Source File : ClothFactory.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
public static GameObject GetHair(GameObject reference, string name, Material material, Color color)
{
List<GameObject> list;
bool flag = ClothFactory.clothCache.TryGetValue(name, out list);
GameObject result;
if (flag)
{
for (int i = 0; i < list.Count; i++)
{
GameObject gameObject = list[i];
bool flag2 = gameObject == null;
if (flag2)
{
Debug.Log("Hair is null");
list.RemoveAt(i);
i = Mathf.Max(i - 1, 0);
}
else
{
ParentFollow component = gameObject.GetComponent<ParentFollow>();
bool flag3 = !component.isActiveInScene;
if (flag3)
{
component.isActiveInScene = true;
gameObject.renderer.material = material;
gameObject.renderer.material.color = color;
gameObject.GetComponent<Cloth>().enabled = true;
gameObject.GetComponent<SkinnedMeshRenderer>().enabled = true;
gameObject.GetComponent<ParentFollow>().SetParent(reference.transform);
ClothFactory.ReapplyClothBones(reference, gameObject);
return gameObject;
}
}
}
GameObject gameObject2 = ClothFactory.GenerateCloth(reference, name);
gameObject2.renderer.material = material;
gameObject2.renderer.material.color = color;
gameObject2.AddComponent<ParentFollow>().SetParent(reference.transform);
list.Add(gameObject2);
ClothFactory.clothCache[name] = list;
result = gameObject2;
}
else
{
GameObject gameObject2 = ClothFactory.GenerateCloth(reference, name);
gameObject2.renderer.material = material;
gameObject2.renderer.material.color = color;
gameObject2.AddComponent<ParentFollow>().SetParent(reference.transform);
list = new List<GameObject>
{
gameObject2
};
ClothFactory.clothCache.Add(name, list);
result = gameObject2;
}
return result;
}
19
View Source File : ClothFactory.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private static void ReapplyClothBones(GameObject reference, GameObject clothObject)
{
SkinnedMeshRenderer component = reference.GetComponent<SkinnedMeshRenderer>();
SkinnedMeshRenderer component2 = clothObject.GetComponent<SkinnedMeshRenderer>();
component2.bones = component.bones;
component2.transform.localScale = Vector3.one;
}
19
View Source File : CustomCharacterManager.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void freshLabel()
{
this.labelSex.GetComponent<UILabel>().text = this.sexOption[this.sexId].ToString();
this.labelEye.GetComponent<UILabel>().text = "eye_" + this.eyeId.ToString();
this.labelFace.GetComponent<UILabel>().text = "face_" + this.faceId.ToString();
this.labelGlreplaced.GetComponent<UILabel>().text = "glreplaced_" + this.glreplacedId.ToString();
this.labelHair.GetComponent<UILabel>().text = "hair_" + this.hairId.ToString();
this.labelSkin.GetComponent<UILabel>().text = "skin_" + this.skinId.ToString();
this.labelCostume.GetComponent<UILabel>().text = "costume_" + this.costumeId.ToString();
this.labelCape.GetComponent<UILabel>().text = "cape_" + this.capeId.ToString();
this.labelDivision.GetComponent<UILabel>().text = this.divisionOption[this.divisionId].ToString();
this.labelPOINT.GetComponent<UILabel>().text = "Points: " + (HeroCostume.MaxStats - this.calTotalPoints()).ToString();
this.labelSPD.GetComponent<UILabel>().text = "SPD " + this.setup.myCostume.stat.Spd.ToString();
this.labelGAS.GetComponent<UILabel>().text = "GAS " + this.setup.myCostume.stat.Gas.ToString();
this.labelBLA.GetComponent<UILabel>().text = "BLA " + this.setup.myCostume.stat.Bla.ToString();
this.labelACL.GetComponent<UILabel>().text = "ACL " + this.setup.myCostume.stat.Acl.ToString();
this.labelSKILL.GetComponent<UILabel>().text = "SKILL " + this.setup.myCostume.stat.skillID.ToString();
}
19
View Source File : CustomCharacterManager.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void Start()
{
QualitySettings.SetQualityLevel(5, true);
this.costumeOption = HeroCostume.costumeOption;
this.setup = this.character.GetComponent<HERO_SETUP>();
this.setup.Init();
this.setup.myCostume = new HeroCostume();
this.copyCostume(HeroCostume.costume[2], this.setup.myCostume, false);
this.setup.myCostume.setMesh();
this.setup.SetCharacterComponent();
this.sexOption = new Sex[]
{
Sex.Male,
Sex.Female
};
this.eyeOption = new int[28];
for (int i = 0; i < 28; i++)
{
this.eyeOption[i] = i;
}
this.faceOption = new int[14];
for (int i = 0; i < 14; i++)
{
this.faceOption[i] = i + 32;
}
this.glreplacedOption = new int[10];
for (int i = 0; i < 10; i++)
{
this.glreplacedOption[i] = i + 48;
}
this.hairOption = new int[11];
for (int i = 0; i < 11; i++)
{
this.hairOption[i] = i;
}
this.skinOption = new int[3];
for (int i = 0; i < 3; i++)
{
this.skinOption[i] = i + 1;
}
this.capeOption = new int[2];
for (int i = 0; i < 2; i++)
{
this.capeOption[i] = i;
}
this.divisionOption = new DIVISION[]
{
DIVISION.TraineesSquad,
DIVISION.TheGarrison,
DIVISION.TheMilitaryPolice,
DIVISION.TheSurveryCorps
};
this.skillOption = new string[]
{
"mikasa",
"levi",
"sasha",
"jean",
"marco",
"armin",
"petra"
};
this.CostumeDataToMyID();
this.freshLabel();
}
19
View Source File : HERO_DEAD_BODY_SETUP.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : 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
View Source File : HERO_SETUP.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private GameObject GenerateCloth(GameObject go, string res)
{
if (!go.GetComponent<SkinnedMeshRenderer>())
{
go.AddComponent<SkinnedMeshRenderer>();
}
SkinnedMeshRenderer component = go.GetComponent<SkinnedMeshRenderer>();
Transform[] bones = component.bones;
SkinnedMeshRenderer component2 = ((GameObject)UnityEngine.Object.Instantiate(CacheResources.Load(res))).GetComponent<SkinnedMeshRenderer>();
component2.gameObject.transform.parent = component.gameObject.transform.parent;
component2.transform.localPosition = Vectors.zero;
component2.transform.localScale = Vectors.one;
component2.bones = bones;
component2.quality = SkinQuality.Auto;
return component2.gameObject;
}
19
View Source File : HERO_SETUP.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : 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
View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void attack_sweep(string type = "")
{
this.callreplacedanHAHA();
this.state = "attack_sweep";
this.attackAnimation = "sweep" + type;
this.attackCheckTimeA = 0.4f;
this.attackCheckTimeB = 0.57f;
this.checkHitCapsuleStart = baseT.Find("Amarture/Core/Controller_Body/hip/spine/chest/shoulder_R/upper_arm_R/forearm_R");
this.checkHitCapsuleEnd = baseT.Find("Amarture/Core/Controller_Body/hip/spine/chest/shoulder_R/upper_arm_R/forearm_R/hand_R/hand_R_001");
this.checkHitCapsuleR = 20f;
this.crossFade("attack_" + this.attackAnimation, 0.1f);
this.attackChkOnce = false;
this.sweepSmokeObject.GetComponent<ParticleSystem>().enableEmission = true;
this.sweepSmokeObject.GetComponent<ParticleSystem>().Play();
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (FengGameManagerMKII.LAN)
{
if (Network.peerType == NetworkPeerType.Server)
{
}
}
else if (PhotonNetwork.IsMasterClient)
{
BasePV.RPC("startSweepSmoke", PhotonTargets.Others, new object[0]);
}
}
}
19
View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : 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
View Source File : LevelTriggerRacingEnd.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void OnTriggerStay(Collider other)
{
if (this.disable)
{
return;
}
if (other.gameObject.CompareTag("Player"))
{
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
FengGameManagerMKII.FGM.GameWin();
this.disable = true;
}
else if (other.gameObject.GetComponent<HERO>().BasePV.IsMine)
{
FengGameManagerMKII.FGM.MultiplayerRacingFinish();
this.disable = true;
}
}
}
19
View Source File : ClothFactory.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private static GameObject GenerateCloth(GameObject go, string res)
{
bool flag = go.GetComponent<SkinnedMeshRenderer>() == null;
if (flag)
{
go.AddComponent<SkinnedMeshRenderer>();
}
Transform[] bones = go.GetComponent<SkinnedMeshRenderer>().bones;
SkinnedMeshRenderer component = ((GameObject)UnityEngine.Object.Instantiate(Resources.Load(res))).GetComponent<SkinnedMeshRenderer>();
component.transform.localScale = Vector3.one;
component.bones = bones;
component.quality = SkinQuality.Bone4;
return component.gameObject;
}
19
View Source File : CustomCharacterManager.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
public void nextOption(CreatePart part)
{
if (part == CreatePart.Preset)
{
this.presetId = this.toNext(this.presetId, HeroCostume.costume.Length, 0);
this.copyCostume(HeroCostume.costume[this.presetId], this.setup.myCostume, true);
this.CostumeDataToMyID();
this.setup.DeleteCharacterComponent();
this.setup.SetCharacterComponent();
this.labelPreset.GetComponent<UILabel>().text = HeroCostume.costume[this.presetId].name;
this.freshLabel();
}
else
{
this.toOption(part, true);
}
}
19
View Source File : CustomCharacterManager.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
public void nextStatOption(CreateStat type)
{
if (type == CreateStat.Skill)
{
this.skillId = this.toNext(this.skillId, this.skillOption.Length, 0);
this.setup.myCostume.stat.skillID = this.skillOption[this.skillId];
this.character.GetComponent<CharacterCreateAnimationControl>().playAttack(this.setup.myCostume.stat.skillID);
this.freshLabel();
return;
}
if (this.calTotalPoints() >= HeroCostume.MaxStats)
{
return;
}
this.setStatPoint(type, 1);
}
19
View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void callreplacedan(bool special = false)
{
if (!special && GameObject.FindGameObjectsWithTag("replacedan").Length > 6)
{
return;
}
GameObject[] array = GameObject.FindGameObjectsWithTag("replacedanRespawn");
ArrayList arrayList = new ArrayList();
foreach (GameObject gameObject in array)
{
if (gameObject.transform.parent.name == "replacedanRespawnCT")
{
arrayList.Add(gameObject);
}
}
GameObject gameObject2 = (GameObject)arrayList[UnityEngine.Random.Range(0, arrayList.Count)];
string[] array3 = new string[]
{
"replacedAN_VER3.1"
};
GameObject gameObject3;
if (FengGameManagerMKII.LAN)
{
gameObject3 = (GameObject)Network.Instantiate(CacheResources.Load(array3[UnityEngine.Random.Range(0, array3.Length)]), gameObject2.transform.position, gameObject2.transform.rotation, 0);
}
else
{
gameObject3 = Optimization.Caching.Pool.NetworkEnable(array3[UnityEngine.Random.Range(0, array3.Length)], gameObject2.transform.position, gameObject2.transform.rotation, 0);
}
if (special)
{
GameObject[] array4 = GameObject.FindGameObjectsWithTag("route");
GameObject gameObject4 = array4[UnityEngine.Random.Range(0, array4.Length)];
while (gameObject4.name != "routeCT")
{
gameObject4 = array4[UnityEngine.Random.Range(0, array4.Length)];
}
gameObject3.GetComponent<replacedAN>().SetRoute(gameObject4);
gameObject3.GetComponent<replacedAN>().SetAbnormalType(AbnormalType.Aberrant, false);
gameObject3.GetComponent<replacedAN>().activeRadPow = 0;
gameObject3.GetComponent<replacedAN>().ToCheckPoint((Vector3)gameObject3.GetComponent<replacedAN>().checkPoints[0], 10f);
}
else
{
float num = 0.7f;
float num2 = 0.7f;
if (IN_GAME_MAIN_CAMERA.Difficulty != 0)
{
if (IN_GAME_MAIN_CAMERA.Difficulty == 1)
{
num = 0.4f;
num2 = 0.7f;
}
else if (IN_GAME_MAIN_CAMERA.Difficulty == 2)
{
num = -1f;
num2 = 0.7f;
}
}
if (GameObject.FindGameObjectsWithTag("replacedan").Length == 5)
{
gameObject3.GetComponent<replacedAN>().SetAbnormalType(AbnormalType.Jumper, false);
}
else if (UnityEngine.Random.Range(0f, 1f) >= num)
{
if (UnityEngine.Random.Range(0f, 1f) < num2)
{
gameObject3.GetComponent<replacedAN>().SetAbnormalType(AbnormalType.Jumper, false);
}
else
{
gameObject3.GetComponent<replacedAN>().SetAbnormalType(AbnormalType.Crawler, false);
}
}
gameObject3.GetComponent<replacedAN>().activeRadPow = 40000;
}
if (FengGameManagerMKII.LAN)
{
GameObject gameObject5 = (GameObject)Network.Instantiate(CacheResources.Load("FX/FXreplacedanSpawn"), gameObject3.transform.position, Quaternion.Euler(-90f, 0f, 0f), 0);
gameObject5.transform.localScale = gameObject3.transform.localScale;
}
else
{
GameObject gameObject6 = Optimization.Caching.Pool.NetworkEnable("FX/FXreplacedanSpawn", gameObject3.transform.position, Quaternion.Euler(-90f, 0f, 0f), 0);
gameObject6.transform.localScale = gameObject3.transform.localScale;
}
}
19
View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private GameObject checkIfHitHand(Transform hand)
{
float num = 30f;
Collider[] array = Physics.OverlapSphere(hand.GetComponent<SphereCollider>().transform.position, num + 1f);
foreach (Collider collider in array)
{
if (collider.transform.root.CompareTag("Player"))
{
GameObject gameObject = collider.transform.root.gameObject;
if (gameObject.GetComponent<replacedAN_EREN>())
{
if (!gameObject.GetComponent<replacedAN_EREN>().ireplaced)
{
gameObject.GetComponent<replacedAN_EREN>().hitByreplacedan();
}
return gameObject;
}
if (gameObject.GetComponent<HERO>() && !gameObject.GetComponent<HERO>().IsInvincible())
{
return gameObject;
}
}
}
return null;
}
19
View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private GameObject getNearestHero()
{
GameObject[] array = GameObject.FindGameObjectsWithTag("Player");
GameObject result = null;
float num = float.PositiveInfinity;
foreach (GameObject gameObject in array)
{
if (!gameObject.GetComponent<HERO>() || !gameObject.GetComponent<HERO>().HasDied())
{
if (!gameObject.GetComponent<replacedAN_EREN>() || !gameObject.GetComponent<replacedAN_EREN>().hasDied)
{
float num2 = Mathf.Sqrt((gameObject.transform.position.x - baseT.position.x) * (gameObject.transform.position.x - baseT.position.x) + (gameObject.transform.position.z - baseT.position.z) * (gameObject.transform.position.z - baseT.position.z));
if (gameObject.transform.position.y - baseT.position.y < 450f && num2 < num)
{
result = gameObject;
num = num2;
}
}
}
}
return result;
}
19
View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void killPlayer(GameObject hitHero)
{
if (hitHero != null)
{
Vector3 position = baseT.Find("Amarture/Core/Controller_Body/hip/spine/chest").position;
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
if (!hitHero.GetComponent<HERO>().HasDied())
{
hitHero.GetComponent<HERO>().Die((hitHero.transform.position - position) * 15f * 4f, false);
}
}
else if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (FengGameManagerMKII.LAN)
{
if (!hitHero.GetComponent<HERO>().HasDied())
{
hitHero.GetComponent<HERO>().MarkDie();
}
}
else if (!hitHero.GetComponent<HERO>().HasDied())
{
hitHero.GetComponent<HERO>().MarkDie();
hitHero.GetComponent<HERO>().BasePV.RPC("netDie", PhotonTargets.All, new object[]
{
(hitHero.transform.position - position) * 15f * 4f,
false,
-1,
"Colossal replacedan",
true
});
}
}
}
}
19
View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
[RPC]
public void labelRPC(int health, int maxHealth)
{
if (health < 0)
{
if (healthLabel != null)
{
Destroy(this.healthLabel);
}
}
else
{
if (healthLabel == null)
{
healthLabel = (GameObject)Instantiate(CacheResources.Load("UI/LabelNameOverHead"));
healthLabel.name = "LabelNameOverHead";
healthLabel.transform.parent = transform;
healthLabel.transform.localPosition = new Vector3(0f, 430f, 0f);
float num = 15f;
if (this.size > 0f && this.size < 1f)
{
num = 15f / this.size;
num = Mathf.Min(num, 100f);
}
this.healthLabel.transform.localScale = new Vector3(num, num, num);
healthLabel.GetComponent<UILabel>().text = string.Empty;
TextMesh txt = healthLabel.GetComponent<TextMesh>();
if (txt == null)
{
txt = healthLabel.AddComponent<TextMesh>();
}
MeshRenderer render = healthLabel.GetComponent<MeshRenderer>();
if (render == null)
{
render = healthLabel.AddComponent<MeshRenderer>();
}
render.material = Optimization.Labels.Font.material;
txt.font = Optimization.Labels.Font;
txt.fontSize = 20;
txt.anchor = TextAnchor.MiddleCenter;
txt.alignment = TextAlignment.Center;
txt.color = Colors.white;
txt.text = healthLabel.GetComponent<UILabel>().text;
txt.richText = true;
txt.gameObject.layer = 5;
}
string str = "[7FFF00]";
float num2 = (float)health / (float)maxHealth;
if (num2 < 0.75f && num2 >= 0.5f)
{
str = "[f2b50f]";
}
else if (num2 < 0.5f && num2 >= 0.25f)
{
str = "[ff8100]";
}
else if (num2 < 0.25f)
{
str = "[ff3333]";
}
this.healthLabel.GetComponent<TextMesh>().text = (str + System.Convert.ToString(health)).ToHTMLFormat();
}
}
19
View Source File : COLOSSAL_TITAN.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void neckSteam()
{
this.neckSteamObject.GetComponent<ParticleSystem>().Stop();
this.neckSteamObject.GetComponent<ParticleSystem>().Play();
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer)
{
if (FengGameManagerMKII.LAN)
{
if (Network.peerType == NetworkPeerType.Server)
{
}
}
else if (PhotonNetwork.IsMasterClient)
{
BasePV.RPC("startNeckSteam", PhotonTargets.Others, new object[0]);
}
}
this.isSteamNeed = true;
Transform transform = baseT.Find("Amarture/Core/Controller_Body/hip/spine/chest/neck");
float radius = 30f;
Collider[] array = Physics.OverlapSphere(transform.transform.position - baseT.Forward() * 10f, radius);
foreach (Collider collider in array)
{
if (collider.transform.root.CompareTag("Player"))
{
GameObject gameObject = collider.transform.root.gameObject;
if (!gameObject.GetComponent<replacedAN_EREN>())
{
if (gameObject.GetComponent<HERO>())
{
this.blowPlayer(gameObject, transform);
}
}
}
}
}
19
View Source File : RockThrow.cs
License : GNU General Public License v3.0
Project Creator : aelariane
License : GNU General Public License v3.0
Project Creator : aelariane
private void explore()
{
GameObject gameObject;
if (IN_GAME_MAIN_CAMERA.GameType == GameType.MultiPlayer && PhotonNetwork.IsMasterClient)
{
gameObject = Pool.NetworkEnable("FX/boom6", baseT.position, baseT.rotation, 0);
if (baseT.root.gameObject.GetComponent<EnemyfxIDcontainer>() != null)
{
gameObject.GetComponent<EnemyfxIDcontainer>().myOwnerViewID = baseT.root.gameObject.GetComponent<EnemyfxIDcontainer>().myOwnerViewID;
gameObject.GetComponent<EnemyfxIDcontainer>().replacedanName = baseT.root.gameObject.GetComponent<EnemyfxIDcontainer>().replacedanName;
}
}
else
{
gameObject = Pool.Enable("FX/boom6", baseT.position, baseT.rotation);//(GameObject)UnityEngine.Object.Instantiate(CacheResources.Load("FX/boom6"), baseT.position, baseT.rotation);
}
gameObject.transform.localScale = baseT.localScale;
float num = 1f - Vector3.Distance(IN_GAME_MAIN_CAMERA.BaseCamera.transform.position, gameObject.transform.position) * 0.05f;
num = Mathf.Min(1f, num);
IN_GAME_MAIN_CAMERA.MainCamera.startShake(num, num, 0.95f);
if (IN_GAME_MAIN_CAMERA.GameType == GameType.Single)
{
Pool.Disable(gameObject);
}
else
{
PhotonNetwork.Destroy(BasePV);
}
}
See More Examples