Exemplo n.º 1
0
    /// <summary>
    /// create Target Search
    /// </summary>
    /// <param name="p_Data"></param>
    /// <returns></returns>
    public static TargetSearch CreateTS(TargetData p_Data)
    {
        TargetSearch ts = tsFactory.Create(p_Data.type);

        ts.Deserialize(p_Data);
        return(ts);
    }
Exemplo n.º 2
0
    public const float AnimPlayTime = 1.0f;   //1=アニメーション1ループ

    /// <summary>
    /// 初期化
    /// </summary>
    public override void MyStart()
    {
        base.MyStart();
        attack        = EnemyManager.Instance.SwordAttackPower;
        TargetObject  = EnemyManager.Instance.targetObject;
        attackTrigger = GetComponentInChildren <Charge>();
        targetSearch  = GetComponentInChildren <TargetSearch>();
        targetSearch.searchFinishedFunc = ChargingInit;
        Anim = GetComponent <Animator>();

        Debug.Log(attackTrigger);
        attackTrigger.isEnable = false;
        targetPosIndex         = 0;
        targetPosList          = new List <Vector3>();
        targetPosList.Clear();

        isRotate  = true;
        isDameged = false;

        //エフェクト
        slashFx = Instantiate(EffectManager.Instance.SlashFx);
        slashFx.transform.SetParent(this.gameObject.transform);
        slashFx.transform.localPosition = new Vector3(-0.08f, 1.62f, 1.75f);
        slashFx.transform.rotation      = this.transform.rotation;

        //移動先の座標をリストに格納
        foreach (var i in TargetListObject.GetComponentsInChildren <Transform>())
        {
            targetPosList.Add(i.position);
        }
        targetPosList.RemoveAt(0);//親オブジェクトをリストから削除


        //α値変更
        Renderer render = GetComponentInChildren <Renderer>();

        mat = render.material;
        Color alpha = mat.color;

        alpha.a   = 0;
        mat.color = alpha;
        StartCoroutine(Pop());
    }
    public BattlePlacement(List <BattleCharacterPlacement> teamA, List <BattleCharacterPlacement> teamB)
    {
        _teamA             = new CharacterPlacement(new PlacementPosition(4, 3));
        _teamB             = new CharacterPlacement(new PlacementPosition(4, 3));
        _allCharacterTeamA = new Dictionary <BattleCharacter, PlacementPosition>();
        _allCharacterTeamB = new Dictionary <BattleCharacter, PlacementPosition>();
        Search             = new TargetSearch(this);

        foreach (var member in teamA)
        {
            _allCharacterTeamA.Add(member.Character, member.Position);
            _teamA.TryAddCharacter(member.Character, member.Position);
        }

        foreach (var member in teamB)
        {
            _allCharacterTeamB.Add(member.Character, member.Position);
            _teamB.TryAddCharacter(member.Character, member.Position);
        }
    }
Exemplo n.º 4
0
    /*
     * [Header("Raycast")]
     * [SerializeField,Tooltip("索敵範囲マスク")]
     * private LayerMask layerMask = 1 << 8;
     * [SerializeField, Tooltip("レイを撃つ座標")]
     * private Vector3 rayPos;
     * [SerializeField, Tooltip("半径"), Range(0.1f, 20.0f)]
     * private float radius;
     * private RaycastHit hitInfo;
     */
    /// <summary>
    /// 初期化
    /// </summary>
    public override void MyStart()
    {
        base.MyStart();
        attack       = EnemyManager.Instance.GunAttackPower;
        targetSearch = GetComponentInChildren <TargetSearch>();
        shot         = GetComponentInChildren <Shot>();
        Anim         = GetComponent <Animator>();
        TargetObject = EnemyManager.Instance.targetObject;
        shot.MyStart();
        AttackafterFrag = false;
        //エフェクト
        shotFx = Instantiate(EffectManager.Instance.ShotMotionFx);
        shotFx.transform.SetParent(this.gameObject.transform);
        shotFx.transform.position = shot.transform.position;             //エフェクトの座標
        //α値変更
        Renderer render = GetComponentInChildren <Renderer>();

        mat = render.material;
        Color alpha = mat.color;

        alpha.a   = 0;
        mat.color = alpha;
        StartCoroutine(Pop());
    }