static int FindChild(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        GameObject arg0 = (GameObject)LuaScriptMgr.GetUnityObject(L, 1, typeof(GameObject));
        string     arg1 = LuaScriptMgr.GetLuaString(L, 2);
        GameObject o    = TransformFinder.FindChild(arg0, arg1);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
    static int GetTransform(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        TransformFinder obj  = (TransformFinder)LuaScriptMgr.GetUnityObjectSelf(L, 1, "TransformFinder");
        string          arg0 = LuaScriptMgr.GetLuaString(L, 2);
        Transform       o    = obj.GetTransform(arg0);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Esempio n. 3
0
    void Start()
    {
        _gamePanel = GameObject.Find("GamePanel");
        _menuPanel = GameObject.Find("MenuPanel");

        _gamePanel.SetActive(false);

        _gameControllerModel = GameObject.Find("GameController").GetComponent <GameControllerModel>();

        _killCounterText = TransformFinder.FindDeepChild(transform, "KillCounter").GetComponent <Text>();
    }
Esempio n. 4
0
        protected override void OnInitialize()
        {
            var panel = TransformFinder.Find("Menu/ErrorContainer");

            _panelVisibility = panel.GetChild(0);

            _buttons = new ButtonList("ErrorContainer/ErrorPanelContainer/ButtonPanel");

            _messageText = ComponentFinder.Find <InputField>("ErrorPanel/Scroll View/Viewport/Content", _panelVisibility);

            _backButton = _buttons.GetButton("BackButtonContainer");
            _backButton.onClick.AddListener(OnBackButtonClick);
        }
Esempio n. 5
0
    void Awake()
    {
        errorPanel = GameObject.Find("errorPanel");
        GameObject text = TransformFinder.FindChild(errorPanel, "txt_errorInfo");

        if (text != null)
        {
            errorText = text.GetComponent <Text>();
        }
        GameObject btn = TransformFinder.FindChild(errorPanel, "btn_errorEnsure");

        if (btn != null)
        {
            ensureBtn = btn.GetComponent <Button>();
        }
        if (errorPanel != null)
        {
            errorPanel.SetActive(false);
        }
    }
Esempio n. 6
0
    void OnComplate(ResourceRef[] refs)
    {
        GameObject go = GameObject.Instantiate(refs[0].resourceObject.Unity3dObject as GameObject);

        go.name             = refs [0].resourceObject.Unity3dObject.name;
        go.transform.parent = gameObject.transform;

        UnityEngine.Material material = refs[5].resourceObject.Unity3dObject as UnityEngine.Material;

        for (int i = 0; i < 4; i++)
        {
            GameObject          goMesh = new GameObject();
            SkinnedMeshRenderer smr    = goMesh.AddComponent <SkinnedMeshRenderer>();

            ResourceObjectMesh mesh = refs[i + 1].resourceObject as ResourceObjectMesh;
            smr.sharedMesh = mesh.Unity3dObject as UnityEngine.Mesh;

            UnityEngine.Transform[] bones = new UnityEngine.Transform[mesh.joints.Length];
            for (int j = 0; j < mesh.joints.Length; j++)
            {
                bones[j] = TransformFinder.Find(transform, mesh.joints[j]);
                if (bones[j] == null)
                {
                    UnityEngine.Debug.LogError("TransformFinder.Find(" + mesh.joints[j] + ") == null");
                }
            }
            smr.bones               = bones;
            smr.sharedMaterial      = material;
            goMesh.transform.parent = gameObject.transform;
        }

        UnityEngine.AnimationClip clip1 = refs[6].resourceObject.Unity3dObject as UnityEngine.AnimationClip;
        clip1.wrapMode = UnityEngine.WrapMode.Loop;

        Animation animation = gameObject.AddComponent <Animation>();

        animation.AddClip(clip1, "daiji1");
        animation.PlayQueued("daiji1", QueueMode.PlayNow);
    }