UnityEngine.Component.GetComponent()

Here are the examples of the csharp api UnityEngine.Component.GetComponent() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1498 Examples 7

19 View Source File : UIHelper.cs
License : Apache License 2.0
Project Creator : 365082218

public static void InitCanvas(Canvas target)
    {
        //Canvas CurrntCanvas;
        Canvreplacedcaler CurrentScaler;
        //CurrntCanvas = target;
        CurrentScaler = target.GetComponent<Canvreplacedcaler>();
        RectTransform r = target.GetComponent<RectTransform>();
        CanvasWidth = r.sizeDelta.x;
        CanvasHeight = r.sizeDelta.y;
        resolution = CurrentScaler.referenceResolution;
        if (CurrentScaler.screenMatchMode == Canvreplacedcaler.ScreenMatchMode.MatchWidthOrHeight)
            Aspect = (CanvasWidth / Screen.width) * (1 - CurrentScaler.matchWidthOrHeight) + CurrentScaler.matchWidthOrHeight * (CanvasHeight / Screen.height);
    }

19 View Source File : Utility.cs
License : Apache License 2.0
Project Creator : 365082218

public static void Expand(Image image, float width, float height) {
        float full_height = 0;
        float full_width = 0;
        //找到比例小的属性,把比例小的属性拉满到对应的轴
        if (width > height) {
            float height_aspect = UIHelper.resolution.y / height;
            full_height = UIHelper.resolution.y; 
            full_width = width * height_aspect;
        } else {
            float width_aspect = UIHelper.resolution.x / width;
            full_width = UIHelper.resolution.x;
            full_height = height * width_aspect;
        }
        RectTransform rect = image.GetComponent<RectTransform>();
        rect.sizeDelta = new Vector2(full_width, full_height);
    }

19 View Source File : LevelDialog.cs
License : Apache License 2.0
Project Creator : 365082218

void OnSelectLevel(LevelData lev)
    {
        Texture2D loadingTexture = null;
        if (!string.IsNullOrEmpty(lev.BgTexture))
        {
            if (normalLevel)
            {
                loadingTexture = GameObject.Instantiate(Resources.Load<Texture2D>(lev.BgTexture));
              }
            else
            {
                for (int i = 0; i < CombatData.Ins.Chapter.resPath.Count; i++)
                {
                    if (CombatData.Ins.Chapter.resPath[i].EndsWith(lev.BgTexture + ".jpg"))
                    {
                        byte[] array = System.IO.File.ReadAllBytes(CombatData.Ins.Chapter.resPath[i]);
                        Texture2D tex = new Texture2D(0, 0, TextureFormat.ARGB32, false);
                        tex.LoadImage(array);
                        loadingTexture = tex;
                        break;
                    }
                }
            }
        }

        if (loadingTexture != null) {
            background.sprite = Sprite.Create(loadingTexture, new Rect(0, 0, loadingTexture.width, loadingTexture.height), Vector2.zero);
            background.color = Color.white;
        }
        Utility.Expand(background, loadingTexture.width, loadingTexture.height);
        Control("Image").GetComponent<RectTransform>().sizeDelta = background.GetComponent<RectTransform>().sizeDelta;
        select = lev;
        Task.text = select.Name;
        if (selectedBtn != null) {
            selectedBtn.image.color = new Color(1, 1, 1, 0);
            selectedBtn = null;
        }
        selectedBtn = levelBtns[lev.Name];
        selectedBtn.image.color = new Color(144.0f / 255.0f, 104.0f / 255.0f, 104.0f / 255.0f, 104.0f / 255.0f);
    }

19 View Source File : SettingDialog.cs
License : Apache License 2.0
Project Creator : 365082218

void KillFade() {
        if (colorFade != null) {
            colorFade.Pause();
            colorFade.Kill();
            colorFade = null;
            if (flashButton != null) {
                flashButton.GetComponent<Image>().color = initializeColor;
            }
        }
    }

19 View Source File : SettingDialog.cs
License : Apache License 2.0
Project Creator : 365082218

public void FlashButton(Button btn, EKeyList vkey, string format) {
        if (flashing) {
            KillFade();
        }
        flashButton = btn;
        formatString = format;
        flashKey = vkey;
        flashing = true;

        initializeColor = flashButton.GetComponent<Image>().color;
        MyPingPong(flashButton.GetComponent<Image>(), initializeColor, Color.white, 0.5f);
    }

19 View Source File : InfiniteScrollRect.cs
License : Apache License 2.0
Project Creator : 365082218

private void Setup() {
        if (FullScrollView) {
            LayoutElement element;
            if (horizontal) {
                float width = (transform as RectTransform).rect.width;
                for (int i = 0; i < content.childCount; i++) {
                    element = content.GetChild(i).GetComponent<LayoutElement>();
                    if (element != null) {
                        element.minWidth = width;
                        element.preferredWidth = width;
                        if (CustomOtherAxis != float.MinValue) {
                            element.minHeight = CustomOtherAxis;
                            element.preferredHeight = CustomOtherAxis;
                        }
                    }
                }
            } else if (vertical) {
                float height = (transform as RectTransform).rect.height;
                for (int i = 0; i < content.childCount; i++) {
                    element = content.GetChild(i).GetComponent<LayoutElement>();
                    if (element != null) {
                        element.minHeight = height;
                        element.preferredHeight = height;
                        if (CustomOtherAxis != float.MinValue) {
                            element.minWidth = CustomOtherAxis;
                            element.preferredWidth = CustomOtherAxis;
                        }
                    }
                }    
            }
        }
        if (ModifiedScale) {
            AverageChildSize = content.rect.size / content.childCount;
        }
        RefreshCellCount();
    }

19 View Source File : UIAdjust.cs
License : Apache License 2.0
Project Creator : 365082218

public void OnChangeTarget(int uiIndex, GameButton active)
    {
        RectTransform rect = active == null ? null : active.GetComponent<RectTransform>();
        if (Target != null)
            Target.GetComponent<CanvasGroup>().alpha = GameStateMgr.Ins.gameStatus.UIAlpha;
        Target = rect;
        if (Target != null)
            Target.GetComponent<CanvasGroup>().alpha = 1.0f;
        UIIndex = uiIndex;
        box.enabled = Target != null;
        if (Target == null)
            vecOffset.x = vecOffset.y = 0;
    }

19 View Source File : TextEffect.cs
License : Apache License 2.0
Project Creator : 365082218

public static void FlyTo(this Graphic graphic, float duration, float yHeight, bool enter = false)
    {
        RectTransform rt = graphic.rectTransform;
        Color c = graphic.color;
        CanvasGroup g = graphic.GetComponent<CanvasGroup>();
        Sequence mySequence = DOTween.Sequence();
        Tweener move1 = rt.DOLocalMoveY(rt.localPosition.y + yHeight, 0.5f);
        Tweener scale = rt.DOScale(new Vector3(1.5f, 1.5f, 1.0f), 0.5f);
        Tweener alpha1 = graphic.DOColor(new Color(c.r, c.g, c.b, 0), 0.5f);  
        mySequence.SetEase(Ease.OutElastic);
        mySequence.Append(move1);
        mySequence.Join(scale);
        mySequence.AppendInterval(duration);
        mySequence.SetEase(Ease.Unset);
        move1 = rt.DOLocalMoveY(rt.localPosition.y + yHeight - 30.0f, enter ? 1.0f : 0.5f);
        mySequence.Append(move1);
        mySequence.Join(alpha1);
        if (g != null)
        {
            float a = g.alpha;
            Tweener alpha2 = g.DOFade(0, enter ? 1.0f : 0.5f);
            mySequence.Join(alpha2);
        }
    }

19 View Source File : NGUITools.cs
License : Apache License 2.0
Project Creator : 365082218

static public AudioSource PlaySound (AudioClip clip, float volume, float pitch)
	{
		volume *= soundVolume;

		if (clip != null && volume > 0.01f)
		{
			if (mListener == null)
			{
				mListener = GameObject.FindObjectOfType(typeof(AudioListener)) as AudioListener;

				if (mListener == null)
				{
					Camera cam = Camera.main;
					if (cam == null) cam = GameObject.FindObjectOfType(typeof(Camera)) as Camera;
					if (cam != null) mListener = cam.gameObject.AddComponent<AudioListener>();
				}
			}

			if (mListener != null && mListener.enabled && NGUITools.GetActive(mListener.gameObject))
			{
				AudioSource source = mListener.GetComponent<AudioSource>();
				if (source == null) source = mListener.gameObject.AddComponent<AudioSource>();
				source.pitch = pitch;
				source.PlayOneShot(clip, volume);
				return source;
			}
		}
		return null;
	}

19 View Source File : UISelectField.cs
License : Apache License 2.0
Project Creator : 365082218

protected override void Awake()
		{
			base.Awake();
			
			// Get the background image
			if (this.targetGraphic == null)
				this.targetGraphic = this.GetComponent<Image>();
		}

19 View Source File : PostEffectsBase.cs
License : Apache License 2.0
Project Creator : activey

protected bool CheckSupport (bool needDepth)
		{
            isSupported = true;
            supportHDRTextures = SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf);
            supportDX11 = SystemInfo.graphicsShaderLevel >= 50 && SystemInfo.supportsComputeShaders;

            if (!SystemInfo.supportsImageEffects)
			{
                NotSupported ();
                return false;
            }

            if (needDepth && !SystemInfo.SupportsRenderTextureFormat (RenderTextureFormat.Depth))
			{
                NotSupported ();
                return false;
            }

            if (needDepth)
                GetComponent<Camera>().depthTextureMode |= DepthTextureMode.Depth;

            return true;
        }

19 View Source File : ScreenSpaceAmbientOcclusion.cs
License : Apache License 2.0
Project Creator : activey

[ImageEffectOpaque]
        void OnRenderImage (RenderTexture source, RenderTexture destination)
        {
            if (!m_Supported || !m_SSAOShader.isSupported) {
                enabled = false;
                return;
            }
            CreateMaterials ();

            m_Downsampling = Mathf.Clamp (m_Downsampling, 1, 6);
            m_Radius = Mathf.Clamp (m_Radius, 0.05f, 1.0f);
            m_MinZ = Mathf.Clamp (m_MinZ, 0.00001f, 0.5f);
            m_OcclusionIntensity = Mathf.Clamp (m_OcclusionIntensity, 0.5f, 4.0f);
            m_OcclusionAttenuation = Mathf.Clamp (m_OcclusionAttenuation, 0.2f, 2.0f);
            m_Blur = Mathf.Clamp (m_Blur, 0, 4);

            // Render SSAO term into a smaller texture
            RenderTexture rtAO = RenderTexture.GetTemporary (source.width / m_Downsampling, source.height / m_Downsampling, 0);
            float fovY = GetComponent<Camera>().fieldOfView;
            float far = GetComponent<Camera>().farClipPlane;
            float y = Mathf.Tan (fovY * Mathf.Deg2Rad * 0.5f) * far;
            float x = y * GetComponent<Camera>().aspect;
            m_SSAOMaterial.SetVector ("_FarCorner", new Vector3(x,y,far));
            int noiseWidth, noiseHeight;
            if (m_RandomTexture) {
                noiseWidth = m_RandomTexture.width;
                noiseHeight = m_RandomTexture.height;
            } else {
                noiseWidth = 1; noiseHeight = 1;
            }
            m_SSAOMaterial.SetVector ("_NoiseScale", new Vector3 ((float)rtAO.width / noiseWidth, (float)rtAO.height / noiseHeight, 0.0f));
            m_SSAOMaterial.SetVector ("_Params", new Vector4(
                                                     m_Radius,
                                                     m_MinZ,
                                                     1.0f / m_OcclusionAttenuation,
                                                     m_OcclusionIntensity));

            bool doBlur = m_Blur > 0;
            Graphics.Blit (doBlur ? null : source, rtAO, m_SSAOMaterial, (int)m_SampleCount);

            if (doBlur)
            {
                // Blur SSAO horizontally
                RenderTexture rtBlurX = RenderTexture.GetTemporary (source.width, source.height, 0);
                m_SSAOMaterial.SetVector ("_TexelOffsetScale",
                                          new Vector4 ((float)m_Blur / source.width, 0,0,0));
                m_SSAOMaterial.SetTexture ("_SSAO", rtAO);
                Graphics.Blit (null, rtBlurX, m_SSAOMaterial, 3);
                RenderTexture.ReleaseTemporary (rtAO); // original rtAO not needed anymore

                // Blur SSAO vertically
                RenderTexture rtBlurY = RenderTexture.GetTemporary (source.width, source.height, 0);
                m_SSAOMaterial.SetVector ("_TexelOffsetScale",
                                          new Vector4 (0, (float)m_Blur/source.height, 0,0));
                m_SSAOMaterial.SetTexture ("_SSAO", rtBlurX);
                Graphics.Blit (source, rtBlurY, m_SSAOMaterial, 3);
                RenderTexture.ReleaseTemporary (rtBlurX); // blurX RT not needed anymore

                rtAO = rtBlurY; // AO is the blurred one now
            }

            // Modulate scene rendering with SSAO
            m_SSAOMaterial.SetTexture ("_SSAO", rtAO);
            Graphics.Blit (source, destination, m_SSAOMaterial, 4);

            RenderTexture.ReleaseTemporary (rtAO);
        }

19 View Source File : GraphLineCurver.cs
License : Apache License 2.0
Project Creator : activey

void Start()
		{

			LineRenderer line = GetComponent<LineRenderer> ();
			if (line == null) {
				return;
			}
			Vector3 startPosition = line.GetPosition (0);
			Vector3 endPosition = line.GetPosition (1);

			float distance = Vector3.Distance (startPosition, endPosition);

			Vector3 middlePosition = Vector3.MoveTowards (startPosition, endPosition, distance / 4);
			//middlePosition.y = middlePosition.y + 20;

			Vector3[] arrayToCurve = new Vector3[3]{startPosition, middlePosition, endPosition};

			/*List<Vector3> points;
			List<Vector3> curvedPoints;
			int pointsLength = 0;
			int curvedLength = 0;

			if(smoothness < 1.0f) smoothness = 1.0f;

			pointsLength = arrayToCurve.Length;

			curvedLength = (pointsLength*Mathf.RoundToInt(smoothness))-1;
			curvedPoints = new List<Vector3>(curvedLength);

			float t = 0.0f;
			for(int pointInTimeOnCurve = 0;pointInTimeOnCurve < curvedLength+1;pointInTimeOnCurve++){
				t = Mathf.InverseLerp(0,curvedLength,pointInTimeOnCurve);

				points = new List<Vector3>(arrayToCurve);

				for(int j = pointsLength-1; j > 0; j--){
					for (int i = 0; i < j; i++){
						points[i] = (1-t)*points[i] + t*points[i+1];
					}
				}

				curvedPoints.Add(points[0]);
			}

			line.numPositions = curvedPoints.Count;
			for (int index = 0; index < curvedPoints.Count; index++) {
				line.SetPosition (index, curvedPoints [index]);
			}*/

			for (int index = 0; index < arrayToCurve.Length; index++) {
				line.SetPosition (index, arrayToCurve [index]);
			}
		}

19 View Source File : GraphLineTextureAnimation.cs
License : Apache License 2.0
Project Creator : activey

void Update() {
		LineRenderer rend = GetComponent<LineRenderer>();

		float index = Time.time * Speed;

		Vector2 textureShift = new Vector2 (-index, 0);
		rend.material.mainTextureScale = new Vector2 ((rend.GetPosition(0) - rend.GetPosition(rend.positionCount - 1)).magnitude, 1);
		rend.material.mainTextureOffset = textureShift;
	}

19 View Source File : ScreenSpaceAmbientOcclusion.cs
License : Apache License 2.0
Project Creator : activey

void OnEnable () {
            GetComponent<Camera>().depthTextureMode |= DepthTextureMode.DepthNormals;
        }

19 View Source File : SpectateCommand.cs
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 : RacingMovingObject.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Awake()
        {
            ID = nextId++;
            CachedTransform = GetComponent<Transform>();
        }

19 View Source File : CustomMapSkin.cs
License : GNU General Public License v3.0
Project Creator : aelariane

public override void Apply()
        {
            var mat = Camera.main.GetComponent<Skybox>().material;
            for (int i = 0; i < DataLength - 1; i++)
            {
                SkinElement skin = elements[i];
                if (skin != null && skin.IsDone)
                {
                    mat.SetTexture("_" + IndexToName(i) + "Tex", skin.Texture);
                }
            }
            SkinElement groundSkin = elements[6];
            System.Collections.Generic.List<Renderer> tmp = new System.Collections.Generic.List<Renderer>();
            foreach (GameObject go in RC.CustomLevel.groundList)
            {
                if (go != null && go.renderer != null)
                {
                    Renderer[] renders = go.GetComponentsInChildren<Renderer>();
                    foreach (Renderer render in renders)
                    {
                        if (render != null)
                        {
                            tmp.Add(render);
                        }
                    }
                }
            }
            if (groundSkin == null || !groundSkin.IsDone || tmp.Count < 1)
            {
                return;
            }

            foreach (Renderer render in tmp)
            {
                if (render != null)
                {
                    if (groundSkin.Path.ToLower() == "transparent")
                    {
                        render.enabled = false;
                        continue;
                    }
                    TryApplyTexture(groundSkin, render, false);
                }
            }

            Minimap.TryRecaptureInstance();
        }

19 View Source File : LevelSkin.cs
License : GNU General Public License v3.0
Project Creator : aelariane

protected void ApplySkybox()
        {
            if (!SkinSettings.SkyboxSkinsEnabled.Value)
            {
                return;
            }
            Material mat = Camera.main.GetComponent<Skybox>().material;
            int j = 0;
            for (int i = DataLength - 6; i < DataLength; i++, j++)
            {
                SkinElement skin = elements[i];
                if (skin != null && skin.IsDone)
                {
                    skin.Texture.wrapMode = TextureWrapMode.Clamp;
                    mat.SetTexture("_" + IndexToName(j) + "Tex", skin.Texture);
                }
            }
        }

19 View Source File : TriggerColliderWeapon.cs
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 : HERO_SETUP.cs
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

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

[RPC]
    private void playsoundRPC(string sndname)
    {
        Transform transform = baseT.Find(sndname);
        transform.GetComponent<AudioSource>().Play();
    }

19 View Source File : TITAN_CONTROLLER.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Awake()
    {
        view = GetComponent<PhotonView>();
    }

19 View Source File : TriggerColliderWeapon.cs
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 : IN_GAME_MAIN_CAMERA.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Awake()
    {
        BaseCamera = Camera.main;
        MainCamera = this;
        BaseG = gameObject;
        BaseT = transform;
        name = "MainCamera";
        isTyping = false;
        isPausing = false;
        SpecMov = GetComponent<SpectatorMovement>();
        Look = GetComponent<MouseLook>();
        CameraMode = (CameraType)Settings.CameraMode.Value;
        CreateMinimap();
        VideoSettings.Apply();
    }

19 View Source File : DaylightChange.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnSelectionChange()
    {
        if (base.GetComponent<UIPopupList>().selection == "DAY")
        {
            IN_GAME_MAIN_CAMERA.DayLight = DayLight.Day;
        }
        if (base.GetComponent<UIPopupList>().selection == "DAWN")
        {
            IN_GAME_MAIN_CAMERA.DayLight = DayLight.Dawn;
        }
        if (base.GetComponent<UIPopupList>().selection == "NIGHT")
        {
            IN_GAME_MAIN_CAMERA.DayLight = DayLight.Night;
        }
    }

19 View Source File : DownloadTexture.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private IEnumerator Start()
    {
        WWW www = new WWW(this.url);
        yield return www;
        this.mTex = www.texture;
        if (this.mTex != null)
        {
            UITexture ut = base.GetComponent<UITexture>();
            if (ut.material == null)
            {
                this.mMat = new Material(Shader.Find("Unlit/Transparent Colored"));
            }
            else
            {
                this.mMat = new Material(ut.material);
            }
            ut.material = this.mMat;
            this.mMat.mainTexture = this.mTex;
            ut.MakePixelPerfect();
        }
        www.Dispose();
        yield break;
    }

19 View Source File : MapNameChange.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnSelectionChange()
    {
        LevelInfo info = LevelInfo.GetInfo(base.GetComponent<UIPopupList>().selection);
        if (info != null)
        {
            CacheGameObject.Find("LabelLevelInfo").GetComponent<UILabel>().text = info.Description;
        }
    }

19 View Source File : ParticleScaling.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Awake()
    {
        baseT = transform;
        material = GetComponent<ParticleSystem>().renderer.material;
    }

19 View Source File : ParticleScaling.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnEnable()
    {
        baseT = transform;
        material = GetComponent<ParticleSystem>().renderer.material;
    }

19 View Source File : ChatInput.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Start()
    {
        this.mInput = base.GetComponent<UIInput>();
        if (this.fillWithDummyData && this.textList != null)
        {
            for (int i = 0; i < 30; i++)
            {
                this.textList.Add(string.Concat(new object[]
                {
                    (i % 2 != 0) ? "[AAAAAA]" : "[FFFFFF]",
                    "This is an example paragraph for the text list, testing line ",
                    i,
                    "[-]"
                }));
            }
        }
    }

19 View Source File : SetColorOnSelection.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnSelectionChange(string val)
    {
        if (this.mWidget == null)
        {
            this.mWidget = base.GetComponent<UIWidget>();
        }
        switch (val)
        {
            case "White":
                this.mWidget.color = Color.white;
                break;

            case "Red":
                this.mWidget.color = Color.red;
                break;

            case "Green":
                this.mWidget.color = Color.green;
                break;

            case "Blue":
                this.mWidget.color = Color.blue;
                break;

            case "Yellow":
                this.mWidget.color = Color.yellow;
                break;

            case "Cyan":
                this.mWidget.color = Color.cyan;
                break;

            case "Magenta":
                this.mWidget.color = Color.magenta;
                break;
        }
    }

19 View Source File : TypewriterEffect.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Update()
    {
        if (this.mLabel == null)
        {
            this.mLabel = base.GetComponent<UILabel>();
            this.mLabel.supportEncoding = false;
            this.mLabel.symbolStyle = UIFont.SymbolStyle.None;
            this.mText = this.mLabel.font.WrapText(this.mLabel.text, (float)this.mLabel.lineWidth / this.mLabel.cachedTransform.localScale.x, this.mLabel.maxLineCount, false, UIFont.SymbolStyle.None);
        }
        if (this.mOffset < this.mText.Length)
        {
            if (this.mNextChar <= Time.time)
            {
                this.charsPerSecond = Mathf.Max(1, this.charsPerSecond);
                float num = 1f / (float)this.charsPerSecond;
                char c = this.mText[this.mOffset];
                if (c == '.' || c == '\n' || c == '!' || c == '?')
                {
                    num *= 4f;
                }
                this.mNextChar = Time.time + num;
                this.mLabel.text = this.mText.Substring(0, ++this.mOffset);
            }
        }
        else
        {
            UnityEngine.Object.Destroy(this);
        }
    }

19 View Source File : UISliderColors.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Start()
    {
        this.mSlider = base.GetComponent<UISlider>();
        this.Update();
    }

19 View Source File : LanguageSelection.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Start()
    {
        this.mList = base.GetComponent<UIPopupList>();
        this.UpdateList();
        this.mList.eventReceiver = base.gameObject;
        this.mList.functionName = "OnLanguageSelection";
    }

19 View Source File : UIButtonOffset.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnDisable()
    {
        if (this.mStarted && this.tweenTarget != null)
        {
            TweenPosition component = this.tweenTarget.GetComponent<TweenPosition>();
            if (component != null)
            {
                component.position = this.mPos;
                component.enabled = false;
            }
        }
    }

19 View Source File : UIButtonRotation.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnDisable()
    {
        if (this.mStarted && this.tweenTarget != null)
        {
            TweenRotation component = this.tweenTarget.GetComponent<TweenRotation>();
            if (component != null)
            {
                component.rotation = this.mRot;
                component.enabled = false;
            }
        }
    }

19 View Source File : UIButtonScale.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnDisable()
    {
        if (this.mStarted && this.tweenTarget != null)
        {
            TweenScale component = this.tweenTarget.GetComponent<TweenScale>();
            if (component != null)
            {
                component.scale = this.mScale;
                component.enabled = false;
            }
        }
    }

19 View Source File : UICheckboxControlledComponent.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Start()
    {
        UICheckbox component = base.GetComponent<UICheckbox>();
        if (component != null)
        {
            this.mUsingDelegates = true;
            UICheckbox uicheckbox = component;
            uicheckbox.onStateChange = (UICheckbox.OnStateChange)Delegate.Combine(uicheckbox.onStateChange, new UICheckbox.OnStateChange(this.OnActivateDelegate));
        }
    }

19 View Source File : UICheckboxControlledObject.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnEnable()
    {
        UICheckbox component = base.GetComponent<UICheckbox>();
        if (component != null)
        {
            this.OnActivate(component.isChecked);
        }
    }

19 View Source File : UIDragCamera.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Awake()
    {
        if (this.target != null)
        {
            if (this.draggableCamera == null)
            {
                this.draggableCamera = this.target.GetComponent<UIDraggableCamera>();
                if (this.draggableCamera == null)
                {
                    this.draggableCamera = this.target.gameObject.AddComponent<UIDraggableCamera>();
                }
            }
            this.target = null;
        }
        else if (this.draggableCamera == null)
        {
            this.draggableCamera = NGUITools.FindInParents<UIDraggableCamera>(base.gameObject);
        }
    }

19 View Source File : UIDragObject.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void LateUpdate()
    {
        float deltaTime = base.UpdateRealTimeDelta();
        if (this.target == null)
        {
            return;
        }
        if (this.mPressed)
        {
            SpringPosition component = this.target.GetComponent<SpringPosition>();
            if (component != null)
            {
                component.enabled = false;
            }
            this.mScroll = 0f;
        }
        else
        {
            this.mMomentum += this.scale * (-this.mScroll * 0.05f);
            this.mScroll = NGUIMath.SpringLerp(this.mScroll, 0f, 20f, deltaTime);
            if (this.mMomentum.magnitude > 0.0001f)
            {
                if (this.mPanel == null)
                {
                    this.FindPanel();
                }
                if (this.mPanel != null)
                {
                    this.target.position += NGUIMath.SpringDampen(ref this.mMomentum, 9f, deltaTime);
                    if (this.restrictWithinPanel && this.mPanel.clipping != UIDrawCall.Clipping.None)
                    {
                        this.mBounds = NGUIMath.CalculateRelativeWidgetBounds(this.mPanel.cachedTransform, this.target);
                        if (!this.mPanel.ConstrainTargetToBounds(this.target, ref this.mBounds, this.dragEffect == UIDragObject.DragEffect.None))
                        {
                            SpringPosition component2 = this.target.GetComponent<SpringPosition>();
                            if (component2 != null)
                            {
                                component2.enabled = false;
                            }
                        }
                    }
                    return;
                }
            }
            else
            {
                this.mScroll = 0f;
            }
        }
        NGUIMath.SpringDampen(ref this.mMomentum, 9f, deltaTime);
    }

19 View Source File : CameraForLeftEye.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Start()
    {
        this.camera = base.GetComponent<Camera>();
        this.cameraRightEye = this.rightEye.GetComponent<Camera>();
    }

19 View Source File : UIInputValidator.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Start()
    {
        base.GetComponent<UIInput>().validator = new UIInput.Validator(this.Validate);
    }

19 View Source File : EquipItems.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Start()
    {
        if (this.itemIDs != null && this.itemIDs.Length > 0)
        {
            InvEquipment invEquipment = base.GetComponent<InvEquipment>();
            if (invEquipment == null)
            {
                invEquipment = base.gameObject.AddComponent<InvEquipment>();
            }
            int max = 12;
            int i = 0;
            int num = this.itemIDs.Length;
            while (i < num)
            {
                int num2 = this.itemIDs[i];
                InvBaseItem invBaseItem = InvDatabase.FindByID(num2);
                if (invBaseItem != null)
                {
                    invEquipment.Equip(new InvGameItem(num2, invBaseItem)
                    {
                        quality = (InvGameItem.Quality)UnityEngine.Random.Range(0, max),
                        itemLevel = NGUITools.RandomRange(invBaseItem.minItemLevel, invBaseItem.maxItemLevel)
                    });
                }
                else
                {
                    Debug.LogWarning("Can't resolve the item ID of " + num2);
                }
                i++;
            }
        }
        UnityEngine.Object.Destroy(this);
    }

19 View Source File : UIDragObject.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void OnPress(bool pressed)
    {
        if (base.enabled && NGUITools.GetActive(base.gameObject) && this.target != null)
        {
            this.mPressed = pressed;
            if (pressed)
            {
                if (this.restrictWithinPanel && this.mPanel == null)
                {
                    this.FindPanel();
                }
                if (this.restrictWithinPanel)
                {
                    this.mBounds = NGUIMath.CalculateRelativeWidgetBounds(this.mPanel.cachedTransform, this.target);
                }
                this.mMomentum = Vectors.zero;
                this.mScroll = 0f;
                SpringPosition component = this.target.GetComponent<SpringPosition>();
                if (component != null)
                {
                    component.enabled = false;
                }
                this.mLastPos = UICamera.lastHit.point;
                Transform transform = UICamera.currentCamera.transform;
                this.mPlane = new Plane(((!(this.mPanel != null)) ? transform.rotation : this.mPanel.cachedTransform.rotation) * Vectors.back, this.mLastPos);
            }
            else if (this.restrictWithinPanel && this.mPanel.clipping != UIDrawCall.Clipping.None && this.dragEffect == UIDragObject.DragEffect.MomentumAndSpring)
            {
                this.mPanel.ConstrainTargetToBounds(this.target, ref this.mBounds, false);
            }
        }
    }

19 View Source File : UISavedOption.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Awake()
    {
        this.mList = base.GetComponent<UIPopupList>();
        this.mCheck = base.GetComponent<UICheckbox>();
        if (this.mList != null)
        {
            UIPopupList uipopupList = this.mList;
            uipopupList.onSelectionChange = (UIPopupList.OnSelectionChange)Delegate.Combine(uipopupList.onSelectionChange, new UIPopupList.OnSelectionChange(this.SaveSelection));
        }
        if (this.mCheck != null)
        {
            UICheckbox uicheckbox = this.mCheck;
            uicheckbox.onStateChange = (UICheckbox.OnStateChange)Delegate.Combine(uicheckbox.onStateChange, new UICheckbox.OnStateChange(this.SaveState));
        }
    }

19 View Source File : UISlider.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Init()
    {
        this.mInitDone = true;
        if (this.foreground != null)
        {
            this.mFGWidget = this.foreground.GetComponent<UIWidget>();
            this.mFGFilled = ((!(this.mFGWidget != null)) ? null : (this.mFGWidget as UISprite));
            this.mFGTrans = this.foreground.transform;
            if (this.mSize == Vectors.v2zero)
            {
                this.mSize = this.foreground.localScale;
            }
            if (this.mCenter == Vectors.v2zero)
            {
                this.mCenter = this.foreground.localPosition + this.foreground.localScale * 0.5f;
            }
        }
        else if (this.mCol != null)
        {
            if (this.mSize == Vectors.v2zero)
            {
                this.mSize = this.mCol.size;
            }
            if (this.mCenter == Vectors.v2zero)
            {
                this.mCenter = this.mCol.center;
            }
        }
        else
        {
            Debug.LogWarning("UISlider expected to find a foreground object or a box collider to work with", this);
        }
    }

19 View Source File : UISoundVolume.cs
License : GNU General Public License v3.0
Project Creator : aelariane

private void Awake()
    {
        this.mSlider = base.GetComponent<UISlider>();
        this.mSlider.sliderValue = NGUITools.soundVolume;
        this.mSlider.eventReceiver = base.gameObject;
    }

See More Examples