示例#1
0
    public void Init(Player player, Vector2 startPos)
    {
        this.player = player;

        world.beastHolder.AddChild(holder = new FContainer());

        gameObject.transform.position = new Vector3(startPos.x * FPhysics.POINTS_TO_METERS,startPos.y * FPhysics.POINTS_TO_METERS,0);
        gameObject.transform.parent = world.root.transform;

        bodyLink = gameObject.AddComponent<FPNodeLink>();
        bodyLink.Init(holder, false);

        bodySprite = new FSprite("Evil-Eye_"+player.team.numString+"_01");
        holder.AddChild(bodySprite);

        eyeSprite = new FSprite("Eye_" + player.numString);
        eyeSprite.scale = 0.33f;
        holder.AddChild(eyeSprite);
        //holder.alpha = 0.25f;

        goldSprite = new FSprite("Evil-Eye_crown_01");
        holder.AddChild(goldSprite);
        goldSprite.isVisible = false;
        //goldSprite.shader = FShader.Additive;

        InitPhysics();

        holder.ListenForUpdate(HandleUpdate);
        holder.ListenForLateUpdate(HandleLateUpdate);
        holder.ListenForFixedUpdate(HandleFixedUpdate);

        //AddTentacle(new Vector2(-20.0f, -20.0f), -90.0f);
        //AddTentacle(new Vector2(0.0f, -30.0f), 0.0f);
        //AddTentacle(new Vector2(20.0f, -20.0f), 90.0f);
    }