Пример #1
0
 protected override void Awake()
 {
     if (GetComponentInChildren <AnimEventHandler>() != null)
     {
         base.Awake();
         if (m_Animation == null)
         {
             m_Animation = this.GetComponentInChildren <AnimHandler>(true);
         }
         if (m_AnimationEvents == null)
         {
             m_AnimationEvents = this.GetComponentInChildren <AnimEventHandler>(true);
         }
         m_old = true;
     }
     else
     {
         base.Awake();
         if (m_animator == null)
         {
             m_animator = this.GetComponentInChildren <Animator>(true);
         }
         if (m_animatorControl == null)
         {
             m_animatorControl = this.GetComponentInChildren <AnimatorControl>(true);
         }
         if (m_eventHandler == null)
         {
             m_eventHandler = this.GetComponentInChildren <BaseEventHandler>(true);
         }
         m_animator.cullingMode = AnimatorCullingMode.AlwaysAnimate;
     }
 }
Пример #2
0
    void Start()
    {
        _anim = GetComponentInChildren <AnimHandler>();

        _health = _maxHealth;
        _shield = _maxShield;
        _power  = 0;
        modifyPower(0);

        //Set the length of the bars to their respective maxes
        if (_healthSlider)
        {
            healthRect             = _healthSlider.gameObject.GetComponent <RectTransform>();
            healthRect.sizeDelta   = new Vector2(_maxHealth * barLengthMultiplier, BAR_HEIGHT);
            _healthSlider.maxValue = _maxHealth;
        }

        if (_shieldSlider)
        {
            shieldRect             = _shieldSlider.gameObject.GetComponent <RectTransform>();
            shieldRect.sizeDelta   = new Vector2(_maxShield * barLengthMultiplier, BAR_HEIGHT);
            _shieldSlider.maxValue = _maxShield;
        }

        if (_powerSlider)
        {
            powerRect             = _powerSlider.gameObject.GetComponent <RectTransform>();
            powerRect.sizeDelta   = new Vector2(_maxPower * barLengthMultiplier, BAR_HEIGHT);
            _powerSlider.maxValue = _maxPower;
        }
    }
Пример #3
0
 protected override void Awake()
 {
     base.Awake();
     if (m_Animation == null)
     {
         m_Animation = this.GetComponent <AnimHandler>(true);
     }
     if (m_AnimationEvents == null)
     {
         m_AnimationEvents = this.GetComponent <AnimEventHandler>(true);
     }
 }
Пример #4
0
 protected override void Awake()
 {
     base.Awake();
     if (m_AnimationEventHandler == null)
     {
         m_AnimationEventHandler = this.GetComponentInChildren <BaseEventHandler>(true);
     }
     if (m_AnimationHandler == null)
     {
         m_AnimationHandler = this.GetComponent <AnimHandler>(true);
     }
     m_MainView = this.GetComponent <MonsterEntityView>(true);
 }
Пример #5
0
        private void Update()
        {
            Transform transform = FXMainCamera.Instance.CurrentCamera.transform;

            transform.localPosition = Vector3.Lerp(transform.localPosition, Vector3.zero, Time.deltaTime * 4f);
            transform.localRotation = Quaternion.Lerp(transform.localRotation, Quaternion.identity, Time.deltaTime * 4f);
            if (!m_barkTriggered && m_CameraMover.Timer >= m_TiggerBark)
            {
                m_barkTriggered = true;
                GameObject gameObject = ViewManager.Instance.FindView(m_IvenSpawnerID);
                if (gameObject != null)
                {
                    AnimHandler componentInChildren = gameObject.GetComponentInChildren <AnimHandler>();
                    if (componentInChildren != null)
                    {
                        componentInChildren.Play("Command");
                    }
                    else
                    {
                        Debug.LogError("not found iven anim view " + m_IvenSpawnerID);
                    }
                }
                else
                {
                    Debug.LogError("not found iven " + m_IvenSpawnerID);
                }
            }
            if (!m_titleTriggered && m_CameraMover.Timer >= m_TiggerTitleLabel)
            {
                m_titleTriggered = true;
                m_TitleLabel.Show();
            }
            if (!m_finishTriggered && m_CameraMover.Timer >= 1f)
            {
                m_finishTriggered = true;
                StartCoroutine(StopCutscene(1f));
            }
        }
Пример #6
0
        private void treeViewEx1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            if (e.Node.Tag is uint)
            {
                meshToRender = -1;

                uint fileno             = (uint)e.Node.Tag;
                ArchiveFile.FileInfo fi = archiveFile.FileInfos[fileno];
                string ext = Path.GetExtension(fi.FilePath);

                byte[] data = archiveFile.GetFile(fileno);

                switch (ext)
                {
                case ".cmb":
                    renderError = false;
                    if (modelFile != null)
                    {
                        modelFile.Dispose();
                    }
                    modelFile                     = new ModelHandler(data, 0, data.Length);
                    modelFile.Filename            = Path.GetFileName(fi.FilePath);
                    this.Text                     = string.Format("{0} - [{1} - ({2})]", Program.Description, Path.GetFileName(Properties.Settings.Default.LastFile), Path.GetFileName(fi.FilePath));
                    dumpToolStripMenuItem.Enabled = (modelFile != null);

                    AddSepdChunksToTree(treeViewEx1, e.Node);
                    break;

                case ".csab":
                    if (animFile != null)
                    {
                        animFile.Dispose();
                    }
                    animFile          = new AnimHandler(data, 0, data.Length);
                    animFile.Filename = Path.GetFileName(fi.FilePath);

                    // TODO more??
                    break;
                }
            }
            else if (e.Node.Tag is short)
            {
                // assume mesh number
                meshToRender = (short)e.Node.Tag;
            }
            else if (e.Node.Tag is Setup)
            {
                zsiFile.SelectedSetup = (e.Node.Tag as Setup);
            }
            else if (e.Node.Tag is Actor)
            {
                if (zsiFile.SelectedSetup != null)
                {
                    zsiFile.SelectedSetup.SelectedActor = (e.Node.Tag as Actor);
                }
            }
            else if (e.Node.Tag == null)
            {
                meshToRender = -1;
                if (zsiFile != null)
                {
                    zsiFile.SelectedSetup = null;
                }
            }
        }
 public void UpdateAnimationEventContainer(AnimationEventContainer _container)
 {
     AnimHandler.SetAnimationEvent(_container);
 }
 private void CleanupComponents()
 {
     AnimHandler.CleanupAnimHandler();
     MoveHandler.CleanupComponents();
     PlayerInputHandler.CleanupHandler();
 }