Beispiel #1
0
    public virtual ActorView createActor(uint id,
                                         FBTeam team,
                                         string avatarName,
                                         Dictionary <string, string> avatarPart,
                                         float[] runAnimiationNormalSpeed,
                                         float height,
                                         bool gk,
                                         string name,
                                         FiveElements element,
                                         uint roleId)
    {
        ActorView  se = null;
        GameObject ga = ModelResourceLoader.inst.createAvatar(avatarName, avatarPart, go => onActorLoaded(se, go));

        ga.transform.parent = this.transform;
        se        = ga.AddComponent <ActorView>();
        se.id     = id;
        se.testId = id;
        se.team   = team;
        se.runAnimiationNormalSpeed = runAnimiationNormalSpeed;
        se.height   = height;
        se.gk       = gk;
        se.nickName = name;
        se.element  = element;
        se.roleId   = roleId;

        se.onCreate();
        sceneEntityList.Add(id, se);

        return(se);
    }
Beispiel #2
0
 public void init(Vector3 point, Vector3 preVelocity, Vector3 curVelocity, FiveElements kickerElement)
 {
     this.point         = point;
     this.preVelocity   = preVelocity;
     this.curVelocity   = curVelocity;
     this.kickerElement = kickerElement;
 }
Beispiel #3
0
 public void init(Vector3 point, Vector3 normal, Vector3 velocity, FiveElements kickerElement)
 {
     this.point         = point;
     this.normal        = normal;
     this.velocity      = velocity;
     this.kickerElement = kickerElement;
 }
Beispiel #4
0
 public override void unserialize(BytesStream stream)
 {
     base.unserialize(stream);
     point         = stream.readVector3();
     normal        = stream.readVector3();
     velocity      = stream.readVector3();
     kickerElement = (FiveElements)stream.ReadByte();
 }
Beispiel #5
0
    public string getHitNetEffect(FiveElements element)
    {
        var idx = (int)element - 1;

        if (idx < 0 || idx >= superHitNetEffects.Length)
        {
            return(null);
        }
        return(superHitNetEffects[idx]);
    }
Beispiel #6
0
 public void hitWall(Vector3 position, Vector3 normal, FiveElements element)
 {
     if (shootType.HasValue)
     {
         hideTrailEffect();
         shootType = null;
     }
     changeColliderSize(0);
     showHitEffect(config.passHitWallEffect, position, normal);
 }
Beispiel #7
0
 /// <summary>
 /// Loads the multiple value from the specific source object.
 /// </summary>
 /// <param name="value">Another multiple value to copy into the current one.</param>
 public void Load(FiveElements <T> value)
 {
     if (value == null)
     {
         return;
     }
     ItemA = value.ItemA;
     ItemB = value.ItemB;
     ItemC = value.ItemC;
     ItemD = value.ItemD;
     ItemE = value.ItemE;
 }
Beispiel #8
0
        public void init(uint id,
                         uint roleId,
                         FBTeam team,
                         string name,
                         Vector2 position,
                         bool gk,
                         FiveElements element,
                         float height,
                         float[] runAnimiationNormalSpeeds)
        {
            base.init(id);
            this.roleId   = roleId;
            this.team     = team;
            this.name     = name;
            this.position = position;
            this.gk       = gk;
            this.element  = element;
            this.height   = height;
            this.runAnimiationNormalSpeeds = runAnimiationNormalSpeeds;
            switch (roleId)
            {
            case 1:
                avatarName        = "P0102_01";
                avatarPart["000"] = "P0102_01_1_01";
                break;

            case 2:
                avatarName        = "P0504_01";
                avatarPart["000"] = "P0504_01_1_01";
                break;

            case 3:
                avatarName        = "P0307_01";
                avatarPart["000"] = "P0307_01_1_01";
                break;

            case 4:
                avatarName        = "GK0701_01";
                avatarPart["000"] = "GK0701_01_1_01";
                break;

            case 5:
                avatarName        = "GK0701_01";
                avatarPart["000"] = "GK0701_01_1_01";
                break;

            case 6:
                avatarName        = "GK0701_01";
                avatarPart["000"] = "GK0701_01_1_01";
                break;
            }
        }
        public void TestEnum()
        {
            FiveElements elements  = FiveElements.Wood;
            FiveElements elements2 = Serializer.Deserialize <FiveElements>(Serializer.Serialize(elements));

            Assert.AreEqual(elements, elements2);


            TwoElements twoElements = new TwoElements()
            {
                Left = FiveElements.Fire, Right = FiveElements.Water
            };

            byte[]      bytes        = Serializer.Serialize(twoElements);
            TwoElements twoElements2 = Serializer.Deserialize <TwoElements>(bytes);

            Assert.AreEqual(twoElements.Combine(), twoElements2.Combine());
        }
Beispiel #10
0
        public override void unserialize(BytesStream stream)
        {
            base.unserialize(stream);
            team     = (FBTeam)stream.ReadByte();
            position = stream.readVector2();
            height   = stream.ReadSingle();
            for (int i = 0; i < runAnimiationNormalSpeeds.Length; ++i)
            {
                runAnimiationNormalSpeeds[i] = stream.ReadSingle();
            }

            //avatar相关 begin
            avatarName = stream.ReadString();
            for (int i = 0; i < maxAvatarPartNum; i++)
            {
                avatarPart.Add(stream.ReadString(), stream.ReadString());
            }
            //avatar相关 end

            gk      = stream.ReadBoolean();
            name    = stream.ReadString();
            element = (FiveElements)stream.ReadByte();
            roleId  = stream.ReadUInt32();
        }
Beispiel #11
0
    public void hitNet(Vector3 position, Vector3 collidedVelocity, FiveElements element)
    {
        if (shootType.HasValue)
        {
            hideTrailEffect();
            switch (shootType.Value)
            {
            case ShootType.Normal:
            case ShootType.Power:
                showHitEffect(config.normalHitNetEffect, position, collidedVelocity);
                break;

            case ShootType.Super:
                showHitEffect(config.getHitNetEffect(element), position, collidedVelocity);
                break;

            case ShootType.Killer:
                showHitEffect(config.normalHitNetEffect, position, collidedVelocity);
                break;
            }
            shootType = null;
        }
        changeColliderSize(1);
    }
Beispiel #12
0
 public void onBallCollidedNet(FixVector3 point, FixVector3 preVelocity, FixVector3 curVelocity, FiveElements kickerElement)
 {
     fbGame.generateRenderAction <RAL.BallCollidedNetAction>(point.toVector3(), preVelocity.toVector3(), curVelocity.toVector3(), kickerElement);
 }
Beispiel #13
0
 public void onBallCollidedWall(FixVector3 point, FixVector3 normal, FixVector3 velocity, FiveElements kickerElement)
 {
     fbGame.generateRenderAction <RAL.BallCollidedWallAction>(point.toVector3(), normal.toVector3(), velocity.toVector3(), kickerElement);
 }
Beispiel #14
0
 void onBallCollidedWall(FixVector3 point, FixVector3 normal, FixVector3 velocity, FiveElements kickerElement)
 {
     endShoot();
 }