Exemplo n.º 1
0
    /// OBSTACKLES

    internal void RegisterObstackle(MapObstackle pObstackle)
    {
        int id = pObstackle.gameObject.name.GetHashCode();        // Utils.GenerateHash(pObstackle.gameObject.name);

        if (obstackles.ContainsKey(id))
        {
            Debug.LogError($"Obstackle {pObstackle.gameObject.name} already registered. Name has to be unique");
            return;
        }
        //Debug.Log($"RegisterObstackle {pObstackle.gameObject.name} = {id}");
        obstackles.Add(id, pObstackle);
    }
Exemplo n.º 2
0
    protected override void HandleMsg(EPhotonMsg pReceivedMsg, object[] pParams, ByteBuffer bb)
    {
        switch (pReceivedMsg)
        {
        case EPhotonMsg.Map_Obstackle_DoCollisionEffect:
            int          obstackleId = (int)pParams[0];
            MapObstackle obstackle   = game.Map.GetObstackle(obstackleId);
            obstackle.DoCollisionEffect(true);
            break;

        default:
            Debug.LogError("Message not handled");
            break;
        }
    }
Exemplo n.º 3
0
 internal void UnregisterObstackle(MapObstackle pObstackle)
 {
     obstackles.Remove(pObstackle.gameObject.name.GetHashCode());
 }