コード例 #1
0
        /// <summary>
        /// Revives instance.
        /// </summary>
        private void Revive()
        {
            // Return if already revive.
            if (IsRevived)
            {
                return;
            }


            // Return if revive isn't possible.
            if (!CanRevive)
            {
                return;
            }


            // Revive unmanaged model.
            TaskableModel = new CubismTaskableModel(Moc);


            // Revive proxies.
            Parameters = GetComponentsInChildren <CubismParameter>();
            Parts      = GetComponentsInChildren <CubismPart>();
            Drawables  = GetComponentsInChildren <CubismDrawable>();

            Parameters.Revive(TaskableModel.UnmanagedModel);
            Parts.Revive(TaskableModel.UnmanagedModel);
            Drawables.Revive(TaskableModel.UnmanagedModel);

            CanvasInformation = new CubismCanvasInformation(TaskableModel.UnmanagedModel);

            _parameterStore = GetComponent <CubismParameterStore>();
        }
コード例 #2
0
ファイル: CubismModel.cs プロジェクト: teach310/EscapeGame
        /// <summary>
        /// Initializes instance for first use.
        /// </summary>
        /// <param name="moc">Moc to instantiate from.</param>
        private void Reset(CubismMoc moc)
        {
            Moc           = moc;
            name          = moc.name;
            TaskableModel = new CubismTaskableModel(moc);


            // Create and initialize proxies.
            var parameters = CubismParameter.CreateParameters(TaskableModel.UnmanagedModel);
            var parts      = CubismPart.CreateParts(TaskableModel.UnmanagedModel);
            var drawables  = CubismDrawable.CreateDrawables(TaskableModel.UnmanagedModel);


            parameters.transform.SetParent(transform);
            parts.transform.SetParent(transform);
            drawables.transform.SetParent(transform);


            Parameters = parameters.GetComponentsInChildren <CubismParameter>();
            Parts      = parts.GetComponentsInChildren <CubismPart>();
            Drawables  = drawables.GetComponentsInChildren <CubismDrawable>();
        }