Beispiel #1
0
    // Control Function -----------------------------------------------------------------
    void UpdateGrid(bool bShow)
    {
        float   fSize   = FXMakerOption.inst.m_GridSize / FXMakerOption.inst.m_GridUnit;
        Vector2 texSize = new Vector3(FXMakerOption.inst.m_GridSize, FXMakerOption.inst.m_GridSize, 0);
        Vector2 texUnit = new Vector2(fSize, fSize);

        if (m_GridXYGameObject != null)
        {
            NgObject.SetActive(m_GridXYGameObject, (bShow && m_bGridXY));
            m_GridXYGameObject.transform.localScale = texSize;
            m_GridXYGameObject.GetComponent <Renderer>().sharedMaterial.mainTextureScale = texUnit;
        }
        if (m_GridXZGameObject != null)
        {
            NgObject.SetActive(m_GridXZGameObject, (bShow && m_bGridXZ));
            m_GridXYGameObject.transform.localScale = texSize;
            m_GridXYGameObject.GetComponent <Renderer>().sharedMaterial.mainTextureScale = texUnit;
        }
        if (m_GridYZGameObject != null)
        {
            NgObject.SetActive(m_GridYZGameObject, (bShow && m_bGridYZ));
            m_GridXYGameObject.transform.localScale = texSize;
            m_GridXYGameObject.GetComponent <Renderer>().sharedMaterial.mainTextureScale = texUnit;
        }
    }
Beispiel #2
0
    void ChangeActiveState(GameObject oriEffectObject)
    {
        bool bObjEnable = (oriEffectObject.GetComponent <NcDontActive>() == null);

        if (bObjEnable)
        {
            NgObject.SetActive(oriEffectObject, bObjEnable);
        }
        foreach (Transform trans in oriEffectObject.transform)
        {
            ChangeActiveState(trans.gameObject);
        }
    }
Beispiel #3
0
	// ------------------------------------------------------------------
	void UnactiveOriginalObject()
	{
		FXMakerEffect effectToolMain = GetComponent<FXMakerEffect>();
		if (effectToolMain != null && effectToolMain.m_CurrentEffectRoot != null && GetOriginalEffectObject() != null)
		{
			// Original - CheckParent
			if (GetOriginalEffectObject().transform.parent == null)
				GetOriginalEffectObject().transform.parent = effectToolMain.m_CurrentEffectRoot.transform;

			// Unactive
			Transform[] trans = GetOriginalEffectObject().GetComponentsInChildren<Transform>(true);
			foreach (Transform tran in trans)
				NgObject.SetActive(tran.gameObject, false);
		}
	}