Exemple #1
0
    void Start()
    {
        float each_angle = max_angle / (max_count - 1);
        float half_angle = max_angle / 2.0f;

        Vector3 center_vec = end_pos - gameObject.transform.position;
        Vector3 left_vec   = Quaternion.AngleAxis(half_angle, Vector3.back) * center_vec;

        for (int i = 0; i < max_count; ++i)
        {
            Vector3 rotated_end_pos = Quaternion.AngleAxis(each_angle * i, Vector3.forward) * left_vec;

            Quaternion newRotation = CUtility.MakeQuaternion(gameObject.transform.position, rotated_end_pos + gameObject.transform.position);
            // 이미지를 회전 시켜서 위로 바라 보게 만든다.
            Vector3 eulerAngles = newRotation.eulerAngles;
            eulerAngles.z += 90.0f;
            newRotation    = Quaternion.Euler(eulerAngles);

            GameObject LoadedObj = Instantiate <GameObject>(CResourceMgr.LoadEffect("Arrow"), gameObject.transform.position, newRotation);
            CArrow     Arrow     = LoadedObj.GetComponent <CArrow>();
            Arrow.Speed      = speed;
            Arrow.Owner      = Owner;
            Arrow.EndPos     = rotated_end_pos + gameObject.transform.position;
            Arrow.HitAniType = HitAniType;
        }

        Destroy(gameObject);
    }
Exemple #2
0
    public override void Combo2Damage()
    {
        Vector3    TargetVec   = RotateAngle == 0.0f ? gameObject.transform.position + Vector3.right * AttackRange : gameObject.transform.position + Vector3.left * AttackRange;
        Quaternion newRotation = CUtility.MakeQuaternion(gameObject.transform.position, TargetVec);

        // 이미지를 반시계방향으로 회전 시켜서 위로 바라 보게 만든다.
        Vector3 eulerAngles = newRotation.eulerAngles;

        eulerAngles.z += 90.0f;
        newRotation    = Quaternion.Euler(eulerAngles);

        GameObject LoadedObj = Instantiate <GameObject>(CResourceMgr.LoadEffect("IceBolt"), gameObject.transform.position, newRotation);
        CIceBolt   Effect    = LoadedObj.GetComponent <CIceBolt>();

        Effect.Owner  = gameObject;
        Effect.EndPos = TargetVec;
        CCombo1Ani ani = gameObject.GetComponentInChildren <CCombo1Ani>();

        Effect.HitMove    = ani.HitMove;
        Effect.HitAniType = EHitAniType.Type2;
        SoundMgr.PlaySound("Razor2", ESoundType.Motion);
    }
Exemple #3
0
    public override void Combo3Damage()
    {
        Vector3    TargetVec   = RotateAngle == 0.0f ? gameObject.transform.position + Vector3.right : gameObject.transform.position + Vector3.left;
        Quaternion newRotation = CUtility.MakeQuaternion(gameObject.transform.position, TargetVec);
        Vector3    pos         = gameObject.transform.position;

        pos.x = gameObject.transform.position.x + (TargetVec.x - pos.x) / 2.0f;
        pos.z = 1.0f;
        GameObject melee_trail = Instantiate <GameObject>(CResourceMgr.LoadEffect("SwordTrail"), pos, newRotation);

        melee_trail.transform.localScale = new Vector3(2.0f, 2.0f, 1.0f);
        CTrail trail = melee_trail.GetComponent <CTrail>();

        trail.Owner = gameObject;
        CCombo3Ani ani = gameObject.GetComponentInChildren <CCombo3Ani>();

        trail.HitMove    = ani.HitMove;
        trail.HitAniType = EHitAniType.Type3;
        ani.SpriteRendererNone();

        SoundMgr.PlaySound("Attack", ESoundType.Motion);
    }
Exemple #4
0
    public override void Combo1Damage()
    {
        Vector3    TargetVec   = RotateAngle == 0.0f ? gameObject.transform.position + Vector3.right * AttackRange : gameObject.transform.position + Vector3.left * AttackRange;
        Quaternion newRotation = CUtility.MakeQuaternion(gameObject.transform.position, TargetVec);

        // 이미지를 반시계방향으로 회전 시켜서 위로 바라 보게 만든다.
        Vector3 eulerAngles = newRotation.eulerAngles;

        eulerAngles.z += 90.0f;
        newRotation    = Quaternion.Euler(eulerAngles);

        GameObject LoadedObj = Instantiate <GameObject>(CResourceMgr.LoadEffect("Bone"), gameObject.transform.position, newRotation);
        CBone      Effect    = LoadedObj.GetComponent <CBone>();

        Effect.Owner  = gameObject;
        Effect.EndPos = TargetVec;
        CCombo1Ani ani = gameObject.GetComponentInChildren <CCombo1Ani>();

        Effect.HitMove    = ani.HitMove;
        Effect.HitAniType = EHitAniType.Type1;

        //Vector3 TargetVec = RotateAngle == 0.0f ? gameObject.transform.position + Vector3.right : gameObject.transform.position + Vector3.left;
        //Quaternion newRotation = CUtility.MakeQuaternion(gameObject.transform.position, TargetVec);

        //Vector3 pos = gameObject.transform.position;
        //pos.x = gameObject.transform.position.x + (TargetVec.x - pos.x) / 2.0f;
        //pos.z = 1.0f;
        //GameObject melee_trail = Instantiate<GameObject>(CResourceMgr.LoadEffect("SwordTrail"), pos, newRotation);

        //CTrail trail = melee_trail.GetComponent<CTrail>();
        //trail.Owner = gameObject;
        //CCombo1Ani ani = gameObject.GetComponentInChildren<CCombo1Ani>();
        //trail.HitMove = ani.HitMove;
        //trail.HitAniType = EHitAniType.Type1;
        ani.SpriteRendererNone();

        SoundMgr.PlaySound("Attack", ESoundType.Motion);
    }
    public override void Combo1Damage()
    {
        CCombo1Ani ani = gameObject.GetComponentInChildren <CCombo1Ani>();

        ani.SpriteRendererNone();
        Vector3    TargetVec   = RotateAngle == 0.0f ? gameObject.transform.position + Vector3.right * AttackRange : gameObject.transform.position + Vector3.left * AttackRange;
        Quaternion newRotation = CUtility.MakeQuaternion(gameObject.transform.position, TargetVec);

        // 이미지를 반시계방향으로 회전 시켜서 위로 바라 보게 만든다.
        Vector3 eulerAngles = newRotation.eulerAngles;

        eulerAngles.z += 90.0f;
        newRotation    = Quaternion.Euler(eulerAngles);

        GameObject ranged_object = Instantiate <GameObject>(CResourceMgr.LoadEffect("Arrow"), gameObject.transform.position, newRotation);
        CArrow     arrow         = ranged_object.GetComponent <CArrow>();

        arrow.Owner      = gameObject;
        arrow.EndPos     = TargetVec;
        arrow.HitAniType = EHitAniType.Type1;

        SoundMgr.PlaySound("Missile", ESoundType.Motion);
    }