Example #1
0
    protected void GeneralStartImpact(ImpactInfo impactInfo)
    {
        m_StartTime  = Time.time;
        m_IsActive   = true;
        m_ImpactInfo = impactInfo;
        m_ImpactInfo.ApplyOffset(m_ImpactInfo.m_Offset);
        m_IsHitHighLight     = m_ImpactInfo.m_IsHitHighLight;
        m_HitHilghtLightTime = m_ImpactInfo.m_HitHighLightTime;
        ComputeDirectionAndSpeed();
        m_CurVelocity = m_ImpactInfo.m_Velocity;
        if (!m_ImpactInfo.m_Velocity.Equals(Vector3.zero))
        {
            if (Vector3.Dot(m_ImpactInfo.m_Velocity, this.transform.forward) > 0)
            {
                m_HitDirection = HitDirection.BACK;
            }
            else
            {
                m_HitDirection = HitDirection.FRONT;
            }
        }
        if (m_IsHitHighLight && null != m_HighLightMaterial)
        {
            m_Renderer.material = m_HighLightMaterial;
        }
        InterruptSkill();
        SharedGameObjectInfo info = LogicSystem.GetSharedGameObjectInfo(gameObject);

        ImpactPlaySound();
        if (null != info)
        {
            LogicSystem.PublishLogicEvent("ge_set_ai_enable", "ai", info.m_LogicObjectId, false);
        }
        LogicSystem.NotifyGfxAnimationStart(gameObject);
        LogicSystem.NotifyGfxMoveControlStart(gameObject);
    }